3.3全量发送接口
接口说明
向所有设备推送某条消息。
使用场景:活动、系统升级提醒等。
限制:默认是每个app每日可发送一条。
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
/message/all |
Utf-8 |
https |
POST |
application/json |
Curl e.g.: curl -X POST -H 'authToken:${your_auth_token}' -H 'Content-Type:application/json' -d '${your_request_body}' https://api-push.vivo.com.cn/message/all Request body e.g.: { "notifyType":1, "title":"标题1", "content":"内容1", "timeToLive":86400, "skipType":2, "skipContent":"http://www.vivo.com", "networkType":"1", "clientCustomMap":{ "key1":"vlaue1", "key2":"vlaue2" }, "requestId":"25509283-3767-4b9e-83fe-b6e55ac6b123" } Response body e.g.: http status 200: 业务成功: { "result": 0, "desc": "请求成功", "taskId": "12139732" } 业务异常: { "result": xxx, "desc": "xxx不合法" } http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
notifyType |
int |
Y |
通知类型 1:无,2:响铃,3:振动,4:响铃和振动 |
title |
string |
Y |
通知标题(用于通知栏消息) 最大20个汉字(一个汉字等于两个英文字符,一个表情占一个字符,即最大不超过40个英文字符) |
content |
string |
Y |
通知内容(用于通知栏消息) 最大50个汉字(一个汉字等于两个英文字符,一个表情占一个字符,即最大不超过100个英文字符) |
timeToLive |
int |
N |
消息保留时长 单位:秒,取值至少900秒,最长7天。当值为空时,默认一天 |
skipType |
int |
Y |
点击跳转类型 1:打开APP首页 2:打开链接 3:自定义 4:打开app内指定页面 |
skipContent |
string |
N |
跳转内容 跳转类型为2时,跳转内容最大1000个字符,跳转类型为3或4时,跳转内容最大1024个字符,skipType传3需要在onNotificationMessageClicked回调函数中自己写处理逻辑。关于skipContent的内容可以参考【vivo推送常见问题汇总】 pushSDK版本号:480以上,不在支持skipType=3,自定义跳转统一使用skipType=4,详见【vivo推送常见问题汇总】中API接入问题的Q11中的intent uri示例。 |
networkType |
int |
N |
网络方式 -1:不限,1:wifi下发送,不填默认为-1 |
classification |
int |
N |
消息类型 0:运营类消息,1:系统类消息。不填默认为0 |
clientCustomMap |
JSON Object |
N |
客户端自定义键值对 自定义key和Value键值对个数不能超过10个,且长度不能超过1024字符, key和Value键值对总长度不能超过1024字符。app可以按照客户端SDK接入文档获取该键值对 |
requestId |
string |
Y |
用户请求唯一标识 最大64字符 |
输出参数:
属性名字 |
类型 |
描述 |
result |
int |
接口调用是否成功的状态码 0成功,非0失败 |
desc |
string |
文字描述接口调用情况 |
taskId |
string |
任务编号 |
业务异常码详解:
result |
desc |
10054 |
notifyType 不合法 |
10055 |
title 不能为空 |
10056 |
title 长度不能超过40个字符 |
10057 |
content 不能为空 |
10058 |
content 长度不能超过100个字符 |
10059 |
timeToLive 不合法 |
10060 |
skipType 不合法 |
10061 |
skipType = 2, skipContent 不能为空 |
10062 |
skipType = 2, skipContent 不能超过1000个字符 |
10063 |
skipType = 3, skipContent 不能为空 |
10064 |
skipType = 3, skipContent 不能超过1024个字符 |
10065 |
networkType 不合法 |
10066 |
自定义key和Value键值对个数不能超过10个 |
10067 |
自定义key和value键值对不合法 |
10068 |
skipType = 4, skipContent 不能为空 |
10069 |
skipType = 4, skipContent 不能超过1024个字符 |
10352 |
requestId 不能为空 |
10353 |
requestId 长度不能超过64个字符 |
10303 |
requestId 已存在 |
10101 |
消息内容审核不通过 |
10254 |
全量发送超过次数限制 |
10071 |
超出发送时间允许范围 |
10103 |
推送内容含敏感信息 |
10104 |
请发送正式信息,请检查title、content,不要发送测试内容,正式应用发送的title、content里面不能是纯数字,纯英文,纯符号,符号加数字,包含“测试”字样、大括号、中括号 |
10040 |
资源已达上限,稍后重试 |
10085 |
title 或 content 不能为纯表情 |
10073 |
系统消息发送量总量超出限制 |
10082 |
系统消息开关未打开 |
3.4获取消息推送的统计值接口
接口说明
获取taskId对应的统计信息,taskIds最多100个。 注意:查询的消息类型 【群推送消息/列表推消息】
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
/report/getStatistics |
Utf-8 |
https |
GET |
application/json |
Curl e.g.: curl -X GET -H 'authToken:${your_auth_token}' -H 'Content-Type:application/json' https://api-push.vivo.com.cn/report/getStatistics?taskIds=123138209,23498102,3240910940,109283018 Request body e.g.: Response body e.g.: http status 200: 业务成功: { "result":0, "desc":"请求成功", "statistics":[ { "taskId": "298475091219", "target": 10000, "valid": 9500, "send": 9000, "receive": 9000, "display": 8000, "click": 200, "targetInvalid": 200, "targetUnSub": 200, "targetInActive": 100, "covered": 200, "controlled": 200, "targetOffline": 100 }, { "taskId": "298475091220", "target": 10000, "valid": 9500, "send": 9000, "receive": 9000, "display": 8000, "click": 200, "targetInvalid": 200, "targetUnSub": 200, "targetInActive": 100, "covered": 200, "controlled": 200, "targetOffline": 100 } ] } 业务异常: { "result": xxx, "desc": "xxx不合法" } http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
taskIds |
string |
Y |
查询的任务列表taskIds 用,分隔开 e.g.: "234567,234568" |
输出参数:
属性名字 |
类型 |
描述 |
result |
int |
接口调用是否成功的状态码 0成功,非0失败 |
desc |
string |
文字描述接口调用情况 |
taskId |
string |
任务号 |
target |
long |
目标总数 |
targetInvalid |
long |
不存在的用户总数,根据id找不到任何信息 |
targetUnSub |
long |
解订阅的用户总数,用户已卸载或者客户端主动调用turnOffPush()解订阅 |
targetInActive |
long |
14天不在网的用户数,手机14天没有联网,信息被后台删除 |
valid |
long |
有效目标总数 |
covered |
long |
被覆盖的用户消息总数,群推、全推、标签推消息属于营销消息,会被覆盖 |
controlled |
long |
被管控的用户消息总数,例如接收的群推消息总数一天超过5条 |
targetOffline |
long |
推送后不在线的用户数,截止到当前统计时间为止,没有联网的用户数,呈下降趋势 |
send |
long |
下发总数 |
receive |
long |
到达总数 |
display |
long |
展示总数 |
click |
long |
点击总数 |
业务异常码详解:
result |
desc |
10471 |
taskIds 数量不能超过100个 |
10472 |
taskIds 格式错误 |
10473 |
taskIds 为空 |

评论列表