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

内容专题

最近更新时间2023.06.09 14:36:08

首次发布时间2022.05.27 19:15:03

概述

本文档提供内容管理平台专题相关功能的接口调用,帮助客户构建C端信息流专题场景,主要分为三部分:

  • 【专题内容引入】
  • 【专题内容获取】
  • 【区块内容获取】
  • 【专题内容更新】
调前准备
  1. 接口鉴权
    详见:接口鉴权
  2. 接口配置
    详见:专题配置
  3. 调用接口
    注意参数 是否必填,使用正确的 ServiceName、Action、Version 等url信息
    详见:下方接口信息
专题内容引入

如果您需要自有专题内容的引入,请调用该接口引入
若无,可忽略,直接在控制台新建专题即可,详见:新建专题
若需引入火山来源的专题,联系火山人员开通相关功能

请求接口

请求方式

post

请求url:

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

请求header:

ServiceName: volc_content_platform

url组成:

Host: https://cms.volcengineapi.com

Action: TopicCreateFromImport

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
Topics
list<ImportTopicCreateDTO>
专题列表,最大值:100

响应字段

字段名
字段类型
是否必填
说明
ResponseMetadata
ResponseMetadata
Result
Result

请求示例

{
    "Topics": [
        {
            "OpenId": "ew324d",
            "TopicName": "duplicate topic",
            "CoverImgUrl": "https://testimage...",
            "ShareImgUrl": "https://testimage...",
            "Desc": "test description",
            "LandingPageUrl": "https://testlandingpage...",
            "ExtInfo": "other info",
            "HierarchyTags": [
                {
                    "TagName": "testTagName",
                    "TagIdentity": "testTagIdentity",
                    "ParentTagIdentity": "testParentTagIdentity",
                    "TagType": "custom"
                }
            ],
            "Status": "online",
            "PublishTime": 1678947745
        },
        {
            "OpenId": "jkl3md",
            "TopicName": "newTestTopic",
            "CoverImgUrl": "https://testimage...",
            "ShareImgUrl": "https://testimage...",
            "Desc": "test description",
            "LandingPageUrl": "https://testlandingpage...",
            "ExtInfo": "other info",
            "HierarchyTags": [
                {
                    "TagName": "testTagName",
                    "TagIdentity": "testTagIdentity",
                    "ParentTagIdentity": "testParentTagIdentity",
                    "TagType": "custom"
                }
            ],
            "Status": "offline"
        }
    ]
}

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20220527145345010210041035029468FA",
        "Action": "TopicCreateFromImport",
        "Version": "2021-01-01",
        "Service": "volc_content_platform",
        "Region": "cn-north-1"
    },
    "Result": {
        "Topics": [
            {
                "Id": "1733961371358296",
                "TopicSource": "api",
                "OpenId": "jkl3md",
                "Name": "newTestTopic",
                "Description": "test description",
                "CoverImgUrl": "https://testimage...",
                "ShareImgUrl": "https://testimage...",
                "LandingPageUrl": "https://testlandingpage...",
                "Status": "offline",
                "ExtInfo": "other info"
            }
        ],
        "FailedList": [
            {
                "OpenId": "ew324d",
                "TopicName": "duplicate topic",
                "ErrorMsg": "专题已经存在"
            }
        ]
    }
}
专题内容获取

内容推荐接口返回专题基本信息,详见:TopicInfo字段
根据推荐接口返回的GroupType字段,判断文章是否是topic类型,后将专题ID作为入参,调用该接口。

请求接口

请求方式

post

请求url:

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

请求header:

ServiceName: volc_content_api

url组成:

Host: https://cms.volcengineapi.com

Action: GetTopicDetail

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
TopicId
number
专题ID

响应字段

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

相关字段取值

TopicSource
描述
cms
通过控制台新建的专题
api
通过接口引入的专题
toutiao_api
火山专题,开通火山专题后返回

请求示例

{
    "TopicId": 173xxxxxx8189
}

响应示例

{
	"ResponseMetadata": {
		"RequestId": "2022052xxxxxx095B0E1",
		"Action": "GetTopicDetail",
		"Version": "2021-01-01",
		"Service": "volc_content_api",
		"Region": "cn-north-1"
	},
	"Data": {
		"Topic": {
			"Info": {
				"TopicId": 1733246161328189,
				"TopicSource": "cms",
				"OpenId": "",
				"TopicName": "疫情",
				"Description": "文案",
				"CoverImgUrl": "https://p6.toutiaoimg.com/origin/tos-cxxxxxx",
				"ShareImgUrl": "",
				"LandingPageUrl": "",
				"ExtInfo": ""
			},
			"TopicBlockList": [{
				"TopicId": 1733246161328189,
				"BlockId": 1733246772671559,
				"BlockName": "疫情防治",
				"BlockType": "stream",
				"ShowNum": 5,
				"TotalNum": 3,
				"ArticleList": [{
					"GroupId": 1733246138512392,
					"Title": "图文作品同步",
					"Author": {
						"AuthorName": "dayul",
						"AuthorAvatarUrl": "",
						"AuthorId": "1733224045563917",
						"Description": "",
						"HomePage": "",
						"FollowerCount": 0,
						"AuthorBizId": "7020386090683056164"
					},
					"GroupType": "article",
					"GenerateType": "_intelligence_compose_cloud",
					"PublishTime": 1652952326,
					"Abstract": "",
					"OpenId": "7099375050729555486",
					"Tags": [
						"情感偏正向",
						"font-size",
						"Color",
						"font-weight",
						"margin[CSS语法]"
					],
					"CoverImages": [{
						"Url": "https://cms-image.byte-test.cxxxxx",
						"Height": 1080,
						"Weight": 1440,
						"Width": 1440
					}],
					"Extra": "",
					"Link": "",
					"DiggCount": 0,
					"CommentCount": 0,
					"CommentUrl": "",
					"Content": ""
				}]
			}]
		}
	},
	"BaseResp": {
		"StatusMessage": "success",
		"StatusCode": 1000
	}
}
区块内容获取

当通过专题内容获取接口获取到专题以后,可通过该接口获取专题内某个区块的更多文章。

请求接口

post

请求url:

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

请求header:

ServiceName: volc_content_api

url组成:

Host: https://cms.volcengineapi.com

Action: GetTopicBlockDetail

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
TopicId
long
专题ID
BlockId
long
区块ID
Current
int
页数(超过总页数,文章列表返空)

响应字段

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

请求示例

{
    "TopicId": 1733246161328189,
    "BlockId": 1733247401979966,
    "Current": 1
}

响应示例

{
	"ResponseMetadata": {
		"RequestId": "2022052xxxxxxx62975",
		"Action": "GetTopicBlockDetail",
		"Version": "2021-01-01",
		"Service": "volc_content_api",
		"Region": "cn-north-1"
	},
	"Data": {
		"TopicBlock": {
			"TopicId": 1733246161328189,
			"BlockId": 1733247401979966,
			"BlockName": "疫情速报",
			"BlockType": "stream",
			"ShowNum": 5,
			"TotalNum": 3,
			"ArticleList": [{
				"GroupId": 1732935393324077,
				"Title": "北京疫情反弹",
				"Author": {
					"AuthorName": "用户9495864314744",
					"AuthorAvatarUrl": "https://p9-open.onewsixxxxxxx",
					"AuthorId": "1732935393325101",
					"Description": "",
					"HomePage": "https://open.toutiaxxxxxxxxx",
					"FollowerCount": 0,
					"AuthorBizId": "104998173821"
				},
				"GroupType": "video",
				"GenerateType": "toutiao_api",
				"PublishTime": 1652628285,
				"Abstract": "",
				"OpenId": "7097984437438284328",
				"Tags": [
					"北京",
					"视频-地区信息",
					"传染病",
					"其他"
				],
				"CoverImages": [{
					"Url": "http://p3-open-sign.onexxxxxxxxx",
					"Height": 900,
					"Weight": 508,
					"Width": 508
				}],
				"GroupVideos": [{
					"Url": "v0201ag10xxxxxxxxxxxdvg",
					"VideoSize": 404806,
					"CoverImages": {
						"Url": "",
						"Height": 0,
						"Weight": 0,
						"Width": 0
					},
					"VideoWatchCount": 11,
					"VideoDuration": 7.961,
					"Vid": "v0201axxxxxxxxxxdvg"
				}],
				"Extra": "",
				"Link": "https://open.toutiao.coxxxxxxxx",
				"DiggCount": 10,
				"CommentCount": 0,
				"CommentUrl": "https://open.toxxxxxxx",
				"Content": ""
			}]
		}
	},
	"BaseResp": {
		"StatusMessage": "success",
		"StatusCode": 1000
	}
}
专题内容更新

该接口主要用于专题信息的编辑修改。

请求接口

请求方式

post

请求url:

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

请求header:

ServiceName: volc_content_platform

url组成:

Host: https://cms.volcengineapi.com

Action: TopicUpdateFromImport

Version: 2021-01-01

请求参数

字段名
字段类型
是否必填
说明
Topic
ImportTopicUpdateDTO
专题信息

响应字段

字段名
字段类型
是否必填
说明
ResponseMetadata
ResponseMetadata
Result
Result
修正结果

请求示例

{
    "Topic": {
        "OpenId": "ew324d",
        "TopicName": "duplicate topic",
        "CoverImgUrl": "https://testimage...",
        "ShareImgUrl": "https://testimage...",
        "Desc": "test description",
        "LandingPageUrl": "https://testlandingpage...",
        "ExtInfo": "other info",
        "HierarchyTags": [
            {
                "TagName": "testTagName",
                "TagIdentity": "testTagIdentity",
                "ParentTagIdentity": "testParentTagIdentity",
                "TagType": "custom"
            }
        ],
        "Status": "online",
        "PublishTime": 1678947745
    }
}

响应示例

{
    "ResponseMetadata": {
        "RequestId": "20220527145345010210041035029468FA",
        "Action": "TopicCreateFromImport",
        "Version": "2021-01-01",
        "Service": "volc_content_platform",
        "Region": "cn-north-1"
    },
    "Result": {}
}