通知分析接口
通过API获取通知分析接口
- URL:
https://api.nxcloud.com/saas/openapi/analysis/query?page_number={page_number}&page_size={page_size}&start_time={start_time}&end_time={end_time}&tenant_id={tenant_id}&appkey={appkey}&dimension={dimension}&channel={channel}&source={source}&search={search}
- Method:
GET
- Content-Type:
application/json
- 需要鉴权:
是
请求参数
| 参数名 |
类型 |
必选 |
示例值 |
说明 |
| accessKey |
String |
是 |
fme2na3kdi3ki |
用户身份标识 |
| ts |
String |
是 |
1655710885431 |
当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒 |
| bizType |
String |
是 |
2 |
WhatsApp业务类型,取固定值“2” |
| action |
String |
是 |
mt |
WhatsApp业务操作,取固定值“mt” |
| sign |
String |
是 |
6e9506557d1f289501d333ee2c365826 |
API入参参数签名,公共约定 |
parameter 参数:
| 参数名 |
类型 |
必选 |
示例值 |
说明 |
| tenant_id |
Long |
是 |
1 |
租户ID |
| appkey |
String |
是 |
pem28kje |
应用appkey |
| page_number |
integer |
是 |
1 |
页数 |
| page_size |
integer |
是 |
10 |
每页个数 |
| start_time |
String |
是 |
开始查询日期 |
格式为yyyy-MM-dd |
| end_time |
String |
是 |
截止查询日期 |
格式为yyyy-MM-dd (时间查询范围不能超过6个月) |
| dimension |
integer |
是 |
统计维度 |
统计维度, 0: 发送方式, 1: 模板名称, 2: 模板语言,3:国家 |
| source |
integer |
否 |
发送方式 |
当统计维度为发送方式时必填, 发送方式:0 聊天发送,1 群发通知,2对外API,3 机器人4:其他,6:自动通知流程 |
| search |
String |
否 |
搜索内容 |
当统计维度为模板名称、模板语言时为搜索模板名称,当维度为国家时为国家code码搜索 |
| channel |
integer |
是 |
渠道 |
1:SMS,2:WhatsApp,3:Voice ,8:Line |
返回参数说明
| 参数名 |
类型 |
说明 |
| list |
array[data JsonObject] |
请求结果 |
| message |
string |
请求结果说明 |
| code |
integer |
结果编码 |
| total |
integer |
列表总数量 |
| page_number |
integer |
页数 |
| page_size |
integer |
每页数量 |
data
| 参数名 |
类型 |
说明 |
| sendDate |
String |
发送日期 |
| channel |
integer |
渠道 |
| templateName |
String |
模板名称 |
| templateLanguage |
String |
模板语言 |
| templateType |
String |
模板类型 |
| country |
String |
国家 |
| source |
integer |
发送方式 |
| sendTotal |
Long |
发送数量 |
| sent |
Long |
已发送数量 |
| sentRate |
String |
已发送率 |
| deliver |
Long |
已送达 |
| deliverRate |
String |
已送达率 |
| read |
Long |
已读 |
| readRate |
String |
已读率 |
| chatReply |
Long |
已回复 |
| chatReplyRate |
String |
已回复率 |
响应示例
{
"code": 0,
"message": null,
"traceId": "ee0e74276ff14dd58c43512c92ed9958.316.17223233548652651",
"total": 4,
"page_number": 1,
"page_size": 10,
"list": [
{
"sendDate": "2024-07-30",
"channel": 2,
"templateName": "",
"templateLanguage": "",
"templateType": "",
"country": "",
"sendTotal": 0,
"sent": 0,
"sentRate": "",
"deliver": 0,
"deliverRate": "",
"read": 0,
"readRate": "",
"chatReply": 0,
"chatReplyRate": "",
"source": 0
}
],
"ext": null,
"empty": false,
"notEmpty": true,
"totalPages": 4
}
响应码说明
| code |
message |
解决办法 |
| 0 |
请求成功 |
|
| -1 |
请求失败 |
请联系技术人员排除问题 |
| 1000~100X |
鉴权问题 |
详情查看API鉴权部分 |
| 21058 |
参数异常 |
tenant_id 必填 |
| 21059 |
参数异常 |
appkey必填 |
| 22016 |
参数异常 |
商户未配置WhatsApp应用 |
| 22072 |
参数异常 |
参数错误异常 |
| 22215 |
参数异常 |
查询日期间隔不能超过6个月 |