一、錯誤碼4801
{
"status": 4801,
"res": null,
"error": "WhiteIpError: appkey:2f2d7a68f8a40,request:61.174.27.279,webIps:61.174.05.208"
}
遇到這種問題是因為沒有在mob后台添加您調用這個推送接口的外部ip,這里可以看到它提示請求的ip是61.174.27.279,接下來我們到mob后台添加這個ip就好了。
二、V3接口推送鑒權
推送的詳細可以看https://www.mob.com/wiki/detailed/?wiki=MobPushRestAPIfenlei1333&id=136 。這里只講sign的獲取
sign值為(請求體+AppSecret的值)md5加密 32位小寫
例如:
{"source":"webapi","appkey":"2f2d7a68f8a40","pushTarget":{"target":1},"pushNotify":{"plats":[1],"content":"推送的內容","type":1}}9abee316611dd24f607feb9f2c496338
對這一串進行MD5加密得出eb276f35cf6480169b2d3e2e509db680,這個就是sign的值了,下面上推送圖: