You need to enable JavaScript to run this app.
导航

商品关联内容

最近更新时间2024.02.02 16:49:38

首次发布时间2022.03.09 11:33:01

概述

本文档提供内容管理平台增值功能-商品管理功能接口的调用,可通过商品ID获取商品关联的图文、视频等内容列表,共分为两种方式:

  • 【获取单个商品关联内容列表】
  • 【获取批量商品关联内容列表】

说明

如果开启了内容权限,那么将根据场景所属用户组所关联的权限标识对内容进行过滤,保留关联权限标识内容。

调前准备
  1. 接口鉴权
    详见:接口鉴权
  2. 接口配置
    详见:商品配置
  3. 调用接口
    注意参数 是否必填,并确保 ServiceName、Action、Version 等url信息正确
    详见:下方接口信息
获取单个商品关联内容列表

请求接口

请求方式

post

请求url:

https://cms.volcengineapi.com?Action=GetGoodsRelatedArticles&Version=2021-01-01

请求header:

ServiceName: volc_content_api

url组成:

Host: https://cms.volcengineapi.com

Action: GetGoodsRelatedArticles

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
BaseGoodsRelateParam
BaseGoodsRelateParam
商品关联内容所需基本参数
GoodsId
string
商品ID
GenerateTypes
list<string>
查询特定来源的内容,取值路径:控制台 - 内容引入 - 内容源管理 - Api源标识
GroupCategory
string
内容分组,取值路径:控制台 - 商品管理 - 自建商品 - 关联内容 - 分组配置 - 分组标识
PageSize
number
页面大小,默认为10,最大为20
Cursor
string
内容锚点:刷新首页时传空,翻页时传上一次请求返回的Cursor值

相关字段取值

Province
河北、山西、辽宁、吉林、黑龙江、江苏、浙江、安徽、福建、江西、山东、河南、湖北、湖南、广东、海南、四川、贵州、云南、陕西、甘肃、青海、台湾
内蒙古、广西、西藏、宁夏、新疆
北京、天津、上海、重庆
香港、澳门

响应字段

字段名
字段类型
是否必填
说明
ResponseMetadata
ResponseMetadata
BaseResp
BaseResp
Data
DataDetail

请求示例

{
    "GoodsId": "goods_test_1",
    "BaseGoodsRelateParam": {
        "UniqUserId": "user-xxx",
        "Category": "038efxxx",
        "GoodsSourceId": "1722272335075342"
    },
    "PageSize": 2,
    "Cursor": ""
}

响应示例

正常响应示例

{
  "ResponseMetadata": {
    "RequestId": "202201211700000000000000006B69D",
    "Action": "GetGoodsRelatedArticles",
    "Version": "2021-01-01",
    "Service": "volc_content_api",
    "Region": "cn-north-1"
  },
  "Data": {
    "Total": 2,
    "Articles": [
      {
        "GroupId": 1704000000000034,
        "Title": "ChinaSys十周年感想",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://xxxxxxx.pstatp.com/ies/bytedance_official/_next/static/images/0-39.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625627451,
        "DisplayTag": { "tags": "A" },
        "Abstract": "ChinaSys是由国内一批计算机系统方向的学者于2011年创办,今年已经十周年了。",
        "OpenId": "",
        "Tags": [
          "中国",
          "谷歌",
          "中科院",
          "知乎",
          "情感偏正向",
          "论文",
          "开源项目"
        ],
        "CoverImages": [
          {
            "Url": "https://xxxxxxx/v2-b7a37d7390487c6eddd819fd1292e58f_b.jpg",
            "Height": 540,
            "Weight": 720
          }
        ],
        "GroupVideos": [
          {
            "Url": "https://xxxxxxx/71cd8e2f2d5c63e3c1268b635f2/?0prZzMzOjczM0ApZGY7ZTlkaDw2N2RoOzRmNWdicmdxLjFhNl9fLS1jLS9zczYxNF9gLV5hM2M2MF4xL2A6Yw==&amp;vl=&amp;vr=",
            "VideoSize": 6839735418,
            "CoverImage": {
              "Url": "https://xxxxx/large/pgc-image/15324336487100eb5df8e43"
            },
            "VideoWatchCount": 1233,
            "VideoDuration": 178.483
          }
        ],
        "Link": "http://xxxxxxx/p/374658103?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_1", "goods_test_2"]
      },
      {
        "GroupId": 1700000000000703,
        "Title": "让神经科学回归弗洛伊德,意识不过一种感觉?",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://xxxxxx/ies/bytedance_official/_next/static/images/0-390b5def140dc370854c98b8e82ad394.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625626225,
        "DisplayTag": { "tags": "A" },
        "Abstract": "还是个孩子的时候,他就痴迷于宏大的存在主义问题:我们死后会发生什么?",
        "OpenId": "",
        "Tags": [
          "神经科学[生物学机制]",
          "情感偏正向",
          "西蒙·弗洛伊德",
          "神经心理学",
          "大脑皮层",
          "精神分析[治疗神经症的一种方法]"
        ],
        "CoverImages": [
          {
            "Url": "https://xxxxxxx/v2-805182d32ee077f4be4e8a763b2dcbe8_b.jpg",
            "Height": 1280,
            "Width": 720
          }
        ],
        "Link": "http://xxxxxx/p/384574582?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_1", "goods_test_3"]
      }
    ],
    "Cursor": "1625626225"
  },
  "BaseResp": {
    "StatusMessage": "success",
    "StatusCode": 1000
  }
}

异常响应示例

{
	"ResponseMetadata": {
		"RequestId": "2022030909501101021203723026162F8E",
		"Action": "GetGoodsRelatedArticles",
		"Version": "2021-01-01",
		"Service": "volc_content_api",
		"Region": "cn-north-1",
		"Error": {
			"CodeN": 1001,
			"Code": "1001",
			"Message": "get geoCode error geoProvince:"
		}
	},
	"Data": null,
	"BaseResp": {
		"StatusMessage": "get geoCode error geoProvince:",
		"StatusCode": 1001
	}
}

错误代码

详见:错误代码表 - volc_content_api

注意

若需排查日志,请提供 RequestId




获取批量商品关联内容列表

该接口提供获取批量商品关联内容列表的功能。

请求接口

请求方式

post

请求url:

https://cms.volcengineapi.com?Action=MGetGoodsRelatedArticles&Version=2021-01-01

请求header:

ServiceName: volc_content_api

url组成:

Host: https://cms.volcengineapi.com

Action: MGetGoodsRelatedArticles

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
BaseGoodsRelateParam
BaseGoodsRelateParam
商品关联内容所需基本参数
GoodsIds
list<string>
商品ID列表
GenerateTypes
list<string>
查询特定Api来源的内容,取值路径:控制台 - 内容引入 - 内容源管理 - Api源标识
GroupCategory
string
内容分组,取值路径:控制台 - 商品管理 - 关联内容 - 分组配置 - 分组标识
PageSize
number
页面大小,默认为10,最大为20
Cursor
string
内容锚点:刷新首页时传空,翻页时传上一次请求返回的Cursor值

相关字段取值

Province
河北、山西、辽宁、吉林、黑龙江、江苏、浙江、安徽、福建、江西、山东、河南、湖北、湖南、广东、海南、四川、贵州、云南、陕西、甘肃、青海、台湾
内蒙古、广西、西藏、宁夏、新疆
北京、天津、上海、重庆
香港、澳门

响应字段

字段名
字段类型
是否必填
说明
ResponseMetadata
ResponseMetadata
BaseResp
BaseResp
Data
DataDetail

请求示例

{
    "GoodsIds": ["goods_test_1", "goods_test_4"],
    "BaseGoodsRelateParam": {
        "UniqUserId": "user-xxx",
        "Category": "038efe4d",
        "GoodsSourceId": "1722272335075342"
    },
    "PageSize": 4,
    "Cursor": ""
}

响应示例

正常响应示例

{
  "ResponseMetadata": {
    "RequestId": "202201211000000000000000000036B69D",
    "Action": "GetGoodsRelatedArticles",
    "Version": "2021-01-01",
    "Service": "volc_content_api",
    "Region": "cn-north-1"
  },
  "Data": {
    "Total": 4,
    "Articles": [
      {
        "GroupId": 1704593825999934,
        "Title": "ChinaSys十周年感想",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://sf1-scmcdn2-tos.pstatp.com/ies/bytedance_official/_next/static/images/0-390b5def140dc370854c98b8e82ad394.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625627451,
        "DisplayTag": { "tags": "A" },
        "Abstract": "ChinaSys是由国内一批计算机系统方向的学者于2011年创办,今年已经十周年了。",
        "OpenId": "",
        "Tags": [
          "中国",
          "谷歌",
          "中科院",
          "知乎",
          "情感偏正向",
          "论文",
          "开源项目"
        ],
        "CoverImages": [
          {
            "Url": "https://pic4.zhimg.com/v2-b7a37d7390487c6eddd819fd1292e58f_b.jpg",
            "Height": 540,
            "Weight": 720
          }
        ],
        "GroupVideos": [
          {
            "Url": "https://v3.onewsvod.com/71cd8e2f2d5c63e3c1268b635f2225eb/60e67c37/video/tos/hxsy/tos-hxsy-ve-0004/ec12322786b145098092b3db254179d9/?a=34&amp;br=225&amp;bt=225&amp;cd=0|0|0&amp;ch=0&amp;cr=0&amp;cs=0&amp;cv=1&amp;dr=0&amp;ds=1&amp;er=&amp;l=202107081113570102120452073100EB76&amp;lr=&amp;mime_type=video_mp4&amp;net=0&amp;pl=0&amp;qs=0&amp;rc=ajNxbDZ0NmprZzMzOjczM0ApZGY7ZTlkaDw2N2RoOzRmNWdicmdxLjFhNl9fLS1jLS9zczYxNF9gLV5hM2M2MF4xL2A6Yw==&amp;vl=&amp;vr=",
            "VideoSize": 6839735418,
            "CoverImage": {
              "Url": "https://p9-open.onewsimg.com/large/pgc-image/15324336487100eb5df8e43"
            },
            "VideoWatchCount": 1233,
            "VideoDuration": 178.483
          }
        ],
        "Link": "http://zhuanlan.zhihu.com/p/374658103?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_1", "goods_test_2"]
      },
      {
        "GroupId": 1704588081437703,
        "Title": "测试文章3",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://sf1-scmcdn2-tos.pstatp.com/ies/bytedance_official/_next/static/images/0-390b5def140dc370854c98b8e82ad394.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625626225,
        "DisplayTag": { "tags": "A" },
        "Abstract": "还是个孩子的时候,他就痴迷于宏大的存在主义问题:我们死后会发生什么?",
        "OpenId": "",
        "Tags": [
          "神经科学[生物学机制]",
          "情感偏正向",
          "西蒙·弗洛伊德",
          "神经心理学",
          "大脑皮层",
          "精神分析[治疗神经症的一种方法]"
        ],
        "CoverImages": [
          {
            "Url": "https://pic1.zhimg.com/v2-805182d32ee077f4be4e8a763b2dcbe8_b.jpg",
            "Height": 1280,
            "Width": 720
          }
        ],
        "Link": "http://zhuanlan.zhihu.com/p/384574582?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_1", "goods_test_3"]
      },
      {
        "GroupId": 1704593825999936,
        "Title": "ChinaSys十周年感想",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://sf1-scmcdn2-tos.pstatp.com/ies/bytedance_official/_next/static/images/0-390b5def140dc370854c98b8e82ad394.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625625334,
        "DisplayTag": { "tags": "A" },
        "Abstract": "ChinaSys是由国内一批计算机系统方向的学者于2011年创办,今年已经十周年了。",
        "OpenId": "",
        "Tags": [
          "中国",
          "谷歌",
          "中科院",
          "知乎",
          "情感偏正向",
          "论文",
          "开源项目"
        ],
        "CoverImages": [
          {
            "Url": "https://pic4.zhimg.com/v2-b7a37d7390487c6eddd819fd1292e58f_b.jpg",
            "Height": 540,
            "Weight": 720
          }
        ],
        "GroupVideos": [
          {
            "Url": "https://v3.onewsvod.com/71cd8e2f2d5c63e3c1268b635f2225eb/60e67c37/video/tos/hxsy/tos-hxsy-ve-0004/ec12322786b145098092b3db254179d9/?a=34&amp;br=225&amp;bt=225&amp;cd=0|0|0&amp;ch=0&amp;cr=0&amp;cs=0&amp;cv=1&amp;dr=0&amp;ds=1&amp;er=&amp;l=202107081113570102120452073100EB76&amp;lr=&amp;mime_type=video_mp4&amp;net=0&amp;pl=0&amp;qs=0&amp;rc=ajNxbDZ0NmprZzMzOjczM0ApZGY7ZTlkaDw2N2RoOzRmNWdicmdxLjFhNl9fLS1jLS9zczYxNF9gLV5hM2M2MF4xL2A6Yw==&amp;vl=&amp;vr=",
            "VideoSize": 6839735418,
            "CoverImage": {
              "Url": "https://p9-open.onewsimg.com/large/pgc-image/15324336487100eb5df8e43"
            },
            "VideoWatchCount": 1233,
            "VideoDuration": 178.483
          }
        ],
        "Link": "http://zhuanlan.zhihu.com/p/374658103?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_2", "goods_test_4"]
      },
      {
        "GroupId": 1704588081437744,
        "Title": "测试文章4",
        "Author": {
          "AuthorName": "某某作者",
          "AuthorId": "test_author_1",
          "AuthorTags": ["科技博主"],
          "HomePage": "",
          "FollowerCount": 11,
          "AuthorAvatarUrl": "https://sf1-scmcdn2-tos.pstatp.com/ies/bytedance_official/_next/static/images/0-390b5def140dc370854c98b8e82ad394.png"
        },
        "GroupType": "article",
        "GenerateType": "zhihu",
        "PublishTime": 1625622662,
        "DisplayTag": { "tags": "A" },
        "Abstract": "还是个孩子的时候,他就痴迷于宏大的存在主义问题:我们死后会发生什么?",
        "OpenId": "",
        "Tags": [
          "神经科学[生物学机制]",
          "情感偏正向",
          "西蒙·弗洛伊德",
          "神经心理学",
          "大脑皮层",
          "精神分析[治疗神经症的一种方法]"
        ],
        "CoverImages": [
          {
            "Url": "https://pic1.zhimg.com/v2-805182d32ee077f4be4e8a763b2dcbe8_b.jpg",
            "Height": 1280,
            "Width": 720
          }
        ],
        "Link": "http://zhuanlan.zhihu.com/p/384574582?utm_campaign=rss\u0026utm_medium=rss\u0026utm_source=rss\u0026utm_content=title",
        "GoodsIds": ["goods_test_4"]
      }
    ],
    "Cursor": "1625622662"
  },
  "BaseResp": {
    "StatusMessage": "success",
    "StatusCode": 1000
  }
}

异常响应示例

{
	"ResponseMetadata": {
		"RequestId": "2022030909501101021203723026162F8E",
		"Action": "GetGoodsRelatedArticles",
		"Version": "2021-01-01",
		"Service": "volc_content_api",
		"Region": "cn-north-1",
		"Error": {
			"CodeN": 1001,
			"Code": "1001",
			"Message": "get geoCode error geoProvince:"
		}
	},
	"Data": null,
	"BaseResp": {
		"StatusMessage": "get geoCode error geoProvince:",
		"StatusCode": 1001
	}
}

错误代码

详见:错误代码表 - volc_content_api

注意

若需排查日志,请提供 RequestId