数据洞察 - 指标对比¶
本接口在 v24.12 版本中引入
请求方式¶
Request Method: POST
Request URL: /openapi/v1/workspaces/{workspaceId}/data/attribution-comparisons/
Request Header:
Authorization: "{连接密钥}"
请求参数¶
{
"memberUid": "{memberUid}",
"question": "{question}",
"comparisonType": "yoy"
}
请求参数说明¶
| 参数 | 类型 | 是否必填 | 说明 |
|---|---|---|---|
| workspaceId | string | 是 | 工作区的 id |
| memberUid | string | 是 | 工作区中成员的 uid |
| question | string | 是 | 问题,需要包含 时间范围 和 单指标,比如“今年净营业额” |
| comparisonType | string | 是 | 对比类型,yoy - 同比,ring - 环比 |
| 连接密钥 | string | 是 | API密钥 |
返回结果¶
正常情况下返回结果如下:
{
"errcode": 200,
"errmsg": "success",
"data": {
"comparisonType": "yoy",
"validComparisonTypes": ["yoy", "ring"],
"measureCurrent": {
"name": "净营业额",
"value": 1198465390.3810415,
"format": "float",
"currencyCode": "CNY",
"subTitle": "2024-02-25 至 03-25",
"cumulative": false
},
"measurePrevious": {
"name": "净营业额",
"value": 1063796481.8273959,
"format": "float",
"currencyCode": "CNY",
"subTitle": "2023-02-25 至 03-25",
"cumulative": false
}
}
}
返回结果说明¶
| 字段 | 说明 | 值 |
|---|---|---|
| comparisonType | 对比类型 | yoy - 同比,ring - 环比 |
| measureCurrent | 当期指标 | 当期的指标值 |
| measurePrevious | 往期指标 | 往期的指标值 |
因为参数错误或者其他情况,可能返回错误信息,需要根据提示处理。