DID短信结果回调(加签) - nxtele/http-api-document GitHub Wiki

简要描述:

  • 通过DID号码进行短信上行结果推送
  • DID号码进行短信下行后的回执回调

请求URL:

  • 客户短信上行推送地址:由客户提供,客户接口必须按照如下格式编写

  • 例如: http://did.nxcloud.com/didsms/smsUpPushTest

  • 该推送地址作为短信上行的结果推送和短信下行后的回执回调

  • 推送内容格式:由客户在客户端的号码配置中配置

  • 配置json方式,回调就会用该API文档所说明的参数格式并加签进行回调

请求方式:

  • URL:http://did.nxcloud.com/didsms/smsUpPushTest
  • Method:POST
  • Content-Type:application/json
  • 是否加签:

参数说明

header参数

参数名 类型 必选 示例值 说明
accessKey String fme2na3kdi3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒)
bizType String 4 did业务类型,取固定值“4”
action String mtsend did业务操作,取固定值“dr”或“mo”,dr是短信下行的dr回执推送,mo是上行短信的结果推送
sign String 6e9506557d1f289501d333ee2c365826 API入参参数签名,签名算法

请求参数:

参数名 必选 类型 说明
messageId string 短信id
type string 短信类型:0上行,1下行
toPhone string 接收短信的号码(DID号码)
fromPhone string 发送短信的号码
content string 接收的短信内容
size string 计费条数
price string 单价
receiveTime string 接收时间
smsStatus string 短信状态 DELIVRD(到达)\ UNDELIVR(未到达)

推送示例

curl --location --request POST 'http://did.nxcloud.com/didsms/smsUpPushTest' \
--header 'accesskey: kGp5uFHN' \
--header 'action: dr' \
--header 'biztype: 4' \
--header 'ts: 1690361994834' \
--header 'sign: d8200fa495be3bcd5fda3bc25502131b' \
--header 'Content-Type: application/json' \
--data-raw '{
    "messageId": "fcf3432fd1834ccdac807a7cfb2d1fdf",
    "toPhone": "18184505018",
    "fromPhone": "12347200160",
    "content": "sunt non nisi",
    "size": "1",
    "price": "0.0360",
    "receiveTime": "2021-02-07 14:54:00",
    "smsStatus": "DELIVRD"
}'

用户返回值 成功返回字符串:success 失败返回字符串:error