流量来源
接口说明
获取小程序的留资组件配置的流量来源数据。数据内容可参考“小程序控制台-数据-数据中心-能力-线索组件-流量来源”页面
使用限制
- 每日 14:00 前更新前一日数据
- 只能查询昨天以前,且是近90天内的数据
基本信息
| 名称 | 描述 |
|---|---|
| HTTP URL | https://open.douyin.com/api/platform/v2/data_analysis/query_component_with_source/ |
| HTTP Method | POST |
| 权限要求 | 服务商代调用场景下,需商家授予数据分析权限集 |
请求参数
请求头
access-token必填String
当非服务商时,调用https://open.douyin.com/oauth/client_token/生成的token
当服务商时,调用https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/生成的token
当服务商时,调用https://open.douyin.com/api/tpapp/v2/auth/get_auth_token/生成的token
content-type必填String
示例:application/json
固定值"application/json"
Body
end_time必填Int64
结束时间,必须是昨天以前的某个时间戳
start_time必填Int64
开始时间,必须是昨天以前的某个时间戳
componentId_listArray<String>
组件配置id(配置的唯一标识)
请求示例
curl --location --request POST 'https://open.douyin.com/api/platform/v2/data_analysis/query_component_with_source/' \ --header 'content-type: application/json' \ --header 'access-token: 0801121846735352506a356a6' \ --data '{"start_time":1113398621,"end_time":377200,"componentId_list":[]}'
响应参数
Body展开全部子属性
err_msg必填String
错误信息
err_no必填Int32
错误码
log_id必填String
排查错误的logId
dataStruct
展开子属性
响应示例
正常响应示例异常响应示例
{ "data": { "ScenesDataList": [ { "Data": { "ComponentClickPv": 24, "ComponentClickUv": 2, "ComponentReportPv": 21, "ComponentReportUv": 2, "ComponentShowPv": 9, "ComponentShowUv": 2 }, "Scenes": "solid_entrance", "ScenesName": "固定入口" }, { "Data": { "ComponentClickPv": 9, "ComponentClickUv": 2, "ComponentReportPv": 1, "ComponentReportUv": 1, "ComponentShowPv": 2, "ComponentShowUv": 2 }, "Scenes": "video", "ScenesName": "短视频" }, { "Data": { "ComponentClickPv": 60, "ComponentClickUv": 7, "ComponentReportPv": 157, "ComponentReportUv": 8, "ComponentShowPv": 36, "ComponentShowUv": 10 }, "Scenes": "other", "ScenesName": "其它" } ] }, "err_msg": "success", "err_no": 0, "log_id": "20230624224047AC0C108A4419A091657E" }
错误码
| HTTP 状态码 | 错误码 | 错误码描述 | 排查建议 |
|---|---|---|---|
| 200 | -1 | 系统错误 | 建议重试,若多次重试失败,可向平台反馈该问题 |
| 200 | 11009 | 参数不合法或缺少参数 | 检查参数合法性,注意参数类型以及是否缺少必要参数 |
| 200 | 28001003 | access_token无效 | 请检查access_token |
| 200 | 28001007 | 必填字段缺失 | 请检查必填字段 |
| 200 | 28001008 | access_token过期 | 请刷新或重新授权access_token |
