概述
實(shí)現(xiàn)短信\xx微信\手機(jī)端消息推送
短信發(fā)送
get url:http://dev.nbeport.com/pns/sms?applicationid=1&mobile=15825561xxx&content=content1{0}&min=5&channel=nbeport
請(qǐng)求參數(shù)
名稱 | 描述 |
---|---|
applicationid | 應(yīng)用ID |
userId | CAS中對(duì)應(yīng)的userid |
mobile | 手機(jī)號(hào)碼 |
content | 內(nèi)容{0},{0},為6位隨機(jī)碼 |
channel | 短信通道 nbeport:電子口岸(默認(rèn)),nbciq:國(guó)檢,nbmsa:海事 |
微信發(fā)送
get url:http://dev.nbeport.com/pns/weixin?applicationid=1&weixinId=2&username=nbshipper1,nbshipper2&templateId=1& content =urlencode({json})
請(qǐng)求參數(shù)
名稱 | 描述 |
---|---|
applicationid | 應(yīng)用ID |
weixinId | 對(duì)應(yīng)微信平臺(tái)編號(hào) |
userId | CAS中對(duì)應(yīng)的userid |
templateId | 模版id |
content | 模版內(nèi)容json 格式葵第, |
手機(jī)推送
get url:http://dev.nbeport.com/pns/app?applicationid=1&username=nbshipper1,nbshipper2&templateId=1& content =urlencode({json})
請(qǐng)求參數(shù)
名稱 | 描述 |
---|---|
applicationid | ?應(yīng)用ID? |
appId | 對(duì)應(yīng)應(yīng)用平臺(tái)編號(hào) |
userId | CAS中對(duì)應(yīng)的userid |
platform | android,ios,all |
content | 模版內(nèi)容json 格式,示例:{Badge:1,Alert :"消息標(biāo)題",Sound:"聲音",CustomizedValues :{"CK1":"CV1","CK2":"CV2"}} |
消息訂閱
get url:http://dev.nbeport.com/pns/link?applicationid=1&appid=1&busnessKey=1& platform=android
請(qǐng)求參數(shù)
名稱 | 描述 |
---|---|
applicationid | ?應(yīng)用ID? |
appId | 對(duì)應(yīng)應(yīng)用平臺(tái)編號(hào),微信\手機(jī)端必填 |
userId | CAS中對(duì)應(yīng)的userid |
platform | android,ios,weixin |
推送訂閱消息
get url:http://dev.nbeport.com/pns/msg?applicationid=1&appid=1&busnessKey=報(bào)關(guān)單號(hào)
請(qǐng)求參數(shù)
名稱 | 描述 |
---|---|
applicationid | ?應(yīng)用ID? |
appId | 對(duì)應(yīng)應(yīng)用平臺(tái)編號(hào),微信\手機(jī)端必填 |
userId | CAS中對(duì)應(yīng)的userid |
templateId | 模版id |
content | 模版內(nèi)容json 格式纪岁, |
SDK調(diào)用
install-package Purple.Pns.Top [TestMethod] public void Top發(fā)送短信() { string mobile = "158255616XX"; string content = "測(cè)試短信發(fā)送,驗(yàn)證碼{0}"; var rs = PnsClient.SendSms(mobile,content,5); Assert.IsNotNull(rs); } <add key="address:pns" value="http://localhost/pns"/>
消息列表
get url:http://localhost/pns/msg?pagesize=10&pageindex=1&applicationId=1
短信消息列表
get url:http://localhost/pns/sms?pagesize=10&pageindex=1&applicationId=1
短信消息詳情
get url:http://localhost/pns/sms/1111-1111-1111-1111
微信消息列表
get url:http://localhost/pns/weixin?pagesize=10&pageindex=1&applicationId=1
微信消息詳情
get url:http://localhost/pns/weixin/1111-1111-1111-1111
app消息列表
get url:http://localhost/pns/app?pagesize=10&pageindex=1&applicationId=1