二.接口定义
1、鉴权
1、1推送鉴权接口
接口说明
要想调用PUSH接口,任何接入方都要有个鉴权操作。其他接口header中必须携带该参数。
接口返回的参数authToken,一个appId可对应多个token,24小时过期,业务方做中心缓存,1-2小时更新一次。
限制:一天限制调用不超过10000次。
访问方式
URL |
编码方式 |
协议 |
method |
Content-Type |
/message/auth |
Utf-8 |
https |
POST |
application/json |
Curl e.g.: curl -X POST -H 'Content-Type:application/json' -d '${your_request_body}' https://api-push.vivo.com.cn/message/auth Request body e.g.: { "appId":10004, "appKey":"25509283-3767-4b9e-83fe-b6e55ac6243e", "timestamp":1501484120000, "sign":"8424f52fd5eaedc16474e4f702d230d2" } Response body e.g.: http status 200: 业务成功: { "result": 0, "desc": "请求成功", "authToken": "24ojds98fu3jqrioeu982134jieds9fq43u09uaf" } 业务异常: { "result": xxx, "desc": "xxx不合法" } http status 500: Internet server error! |
||||
接口定义
输入参数:
属性名字 |
类型 |
是否必填Y/N |
描述 |
appId |
int |
Y |
用户申请推送业务时生成的appId |
appKey |
string |
Y |
用户申请推送业务时获得的appKey |
timestamp |
long |
Y |
Unix时间戳 做签名用,单位:毫秒,且在vivo服务器当前utc时间戳前后十分钟区间内。 |
sign |
string |
Y |
签名 使用MD5算法,字符串trim后拼接(appId+appKey+timestamp+appSecret),然后通过MD5加密得到的值(字母小写) |
输出参数:
属性名字 |
类型 |
描述 |
result |
int |
接口调用是否成功的状态码 0成功,非0失败 |
desc |
string |
文字描述接口调用情况 |
authToken |
string |
当鉴权成功时才会有该字段,推送消息时,需要提供authToken,有效期默认为1天,过期后无法使用。一个appId可对应多个token,24小时过期,业务方做中心缓存,1-2小时更新一次。 |
业务异常码详解:
result |
desc |
10200 |
appId 不能为空 |
10201 |
appKey 不能为空 |
10202 |
appKey 不合法 |
10203 |
timestamp 不能为空 |
10204 |
sign 不能为空 |
10205 |
appId 不存在 |
10206 |
sign 不正确 |
10207 |
timestamp 不合法 |
10250 |
认证接口超过调用次数限制 |

评论列表