9.消息状态查询
9.1消息状态查询
接口说明
由于目前只返回审计相关信息,单推没有同步返回消息审计状态,其他类型的推送有同步返回。所以可通过调用此接口传递消息id,查询消息的状态。目前有调用频率限制,单个app 1次/s, 建议一批类似的消息体查询一次。
使用:
① 发送消息后查询消息的状态(延时在一分钟内)。
②‘审计通过’或 ‘审计不通过的状态还未入库’,返回 【消息状态未知】,审计不通过状态已入库,返回【消息包含敏感词】
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
https://api-push.vivo.com.cn/search/msgStatus |
Utf-8 |
https/http |
GET |
application/json |
Curl e.g.: curl -X GET -H 'authToken:${your_auth_token}' -H 'Content-Type:application/json' -d '${your_request_body}' https://api-push.vivo.com.cn/search/msgStatus?taskIds=taskId1,taskId2 Request body e.g.: { "result": 0, "desc": "success", "data": [ { "taskId": taskId1, "desc": "消息包含敏感词" }, { " taskId ": taskId2, "desc": "消息状态未知" } ] }Response body e.g.: http status 200: http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
taskIds |
string |
Y |
由多个taskId组成的字符串,多个taskId之间用逗号分隔,一次最多查询100个 |
10.查询失效id
10.1失效id查询
接口说明
由于用户卸载、客户端主动调用turnOffPush()解订阅、设备14天不联网还有一部分历史原因,可能造成推送的id无效。开发者可以根据推送时返回的InvalidUser对失效id做标记或者清除处理,或者单独查询本接口,将无效的id过滤,避免占用推送额度。
使用:
① 传递要查询的id,以及id的类型,后台根据保存的id,返回无效的id。
② 建议在推送低峰期,例如晚上或者凌晨调用,将保存的id一批批查询,避免影响应用的推送性能。勿高频调用。
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
/invalidUser/check |
Utf-8 |
https/http |
POST |
application/json |
Curl e.g.: curl -X GET -H 'authToken:${your_auth_token}' -H 'Content-Type:application/json' -d '${your_request_body}' https://api-push.vivo.com.cn/invalidUser/check Request body e.g.: { "userType": 1, "userIds": [ "15547801220021000000000", "15547801220021000000001" ] } Response body e.g.: http status 200: { "invalidUsers": [ "15547801220021000000000", "15547801220021000000001" ] } http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
userIds |
string[] |
Y |
用户id数组 ,单次最大100个 |
userType |
int |
Y |
userId的类型1:regId,2:alias |
11.消息回收
11.1 消息回收接口
接口说明
此接口用于回收已发送给用户的消息。通过传递推送的消息id和具体的用户id、用户类型进行消息回收,消息回收接口调用量和调用速度会占用推送量级和推送速度。
限制:由我司运营人员配置。
消息撤回功能是平台提供给开发者紧急处理运营事故的工具,切勿日常频繁使用,以免对用户体验不当影响。
对于推送内容、应用行为等存在违规的,平台将按《vivo推送运营规则》进行相应处罚。
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
/message/recycle |
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://host:port/message/recycle Request body e.g.: { "taskId":656079923690082304, "userIds": [ "15762048080021000000007", "15762048080021000000008", "15762048080021000000009" ], "userType":1 } Response body e.g.: http status 200: 业务成功: { "result": 0, "desc": "请求成功", "invalidUsers": [ { "status": 1, "userid": "15762048080021000000008" }, { "status": 1, "userid": "15762048080021000000008" } ] } 业务异常: { "result": xxx, "desc": "xxx不合法" }
http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
taskId |
string |
Y |
单播或广播返回的taskId |
userIds |
string[] |
Y |
userId列表。个数大于等于1小于等于100 |
userType |
int |
Y |
用户类型。1:regId;2:alias |
输出参数:
属性名字 |
类型 |
描述 |
result |
int |
接口调用是否成功的状态码 0成功,非0失败 |
desc |
string |
文字描述接口调用情况 |
invalidUsers |
JSON Array |
非法用户信息,包括status和userid,userid为接入方传的regid或者alias,status有三种情况:1.userId不存在 2.卸载或者关闭了通知 3.七天不在线 |
文章均来自互联网如有不妥请联系作者删除QQ:314111741 地址:http://www.mqs.net/post/45045.html
添加新评论