短信下行发送_v1 - nxtele/http-api-document GitHub Wiki

下行短信接口

  • URL:https://api.nxcloud.com/v1/sms/mt
  • Method:POST
  • Content-Type:application/json
  • 需要鉴权:

鉴权机制

鉴权规则请参考地址:API接口调用约定


请求参数

header参数:

参数名 类型 必选 示例值 说明
accessKey String fmexxx3ki 用户身份标识
ts String 1655710885431 当前请求的时间戳(单位是毫秒),牛信服务端允许用户端请求最大时间误差为60秒
bizType String 3 业务类型,取固定值“3”
action String mtsend 业务操作,取固定值“mtsend”
sign String 6e95xxx826 API入参参数签名,签名算法

body参数:

参数名 类型 必选 说明
appKey String 短信应用appkey
phone String 被叫号码(国码+手机号,比如:8615088888888),可以多个并且以","英文逗号隔开。如果是验证码通道的短信应用,不允许一次性提交超过5个号码
content String 短信内容,内容最长1000个字符
sourceAddress String sourceaddress (必须为1-20位数字或英文字母)
sysMessageId String 用户自定义messageid,长度为10-50位之间,类型【0-9a-zA-Z-】(如果手机号码多于一个,此字段不生效)
shortLink String 短链,数据来自于短链列表;如果此处赋值,短信内容里面必须包含#1#才能起作用,请注意
linkVerbose String 该参数设定的为是否收集用户点击行为,若选择收集用户点击行为,则可在控制台中查看点击了该短链接的号码信息。参数:1:收集;0:不收集。默认为收集
drUrl String dr推送地址(如同时在短信应用上也配置有dr推送地址,优先推送dr给本接口配置的地址) ;(如果手机号码多于一个,此字段不生效,请联系noc,设置到具体的短信应用上)
ext String 透传字段,该字段为自定义信息,在回执中会原样返回,仅支持http请求(如果手机号码多于一个,此字段不生效)

请求示例

curl --location --request POST 'http://api2.nxcloud.com/api/sms/mt' \
--header 'accessKey: asdfsdf' \
--header 'bizType: 3' \
--header 'action: mtsend' \
--header 'ts: 1683277109072' \
--header 'sign: 324324324234324' \
--header 'Content-Type: application/json' \
--data-raw '{
    "appKey": "appKey",
    "phone": "18651883168",
    "content": "content"
}'

响应参数

参数名 类型 说明
code string 错误码
message string 请求提示
data JsonObject 系统返回的数据
  • data 参数:
参数名 类型 示例值 说明
messageid String 7db05a1c246b4954b8cca9aeed6792e6 系统返回的消息ID

响应示例

成功示例

{
    "code": 0,
    "message": "Success",
    "data": {
        "messageid": "7db05a1c246b4954b8cca9aeed6792e6"
    }
}

失败示例

{
    "code": 13002,
    "message": "Unavailable app or incorrect key"
}

响应码说明

code 说明
0 Success
-1 Failure
1000~10XX 详情参照API鉴权常见错误码
1100 Customer does not exist / Status is unavailable
1102 Insufficient balance
9000 Request parameter error
13001 Exceeded content length limit (1000 characters)
13002 Unavailable app or incorrect key
13003 IP not in whitelist
13005 Incorrect phone number format
13006 Incorrect source address (Source address must consist of 1 to 20 alphanumeric characters (letters or digits))
13007 Rate limit exceeded (5 messages per hour)
13008 TPS limit exceeded
13009 Empty content or illegal Keywords
13010 Exceeding maximum numbers for verification channel
⚠️ **GitHub.com Fallback** ⚠️