发送语音验证码 API

使用该接口发送语音验证码 (拨打电话) 至一个接收人。阅读本文档前请先阅读 API 通用说明

接口定义

  • 接口名:sms.voice.verification.send
  • HTTP Method:POST
  • Content-Type:application/json

请求参数 (Body)

参数名类型是否必填描述示例值
tostring接听人手机号18509872103
codestring验证码,为 4 或 6 位数字5201

* 注:暂不支持使用国际手机号

请求示例

curl -X POST 'https://uni.apistd.com/?action=sms.voice.verification.send&accessKeyId=YOUR_ACCESS_KEY_ID' \ -H 'Content-Type: application/json' \ -d '{ "to": "1850987xxxx", "code": "5201" }'

响应参数 (Body)

参数名类型描述示例值
codestring返回码101301
messagestring返回信息未设置有效的上游服务商
dataJSON返回结果

返回结果 (data)

参数名类型描述示例值
statusstring发送状态sent
recipientsinteger接听人个数1
messageCountinteger计费语音总条数1
totalAmountnumber总消费金额0.05
payAmountnumber支付消费金额0.05
messagesJSON[]发送语音报告

发送语音报告 (data.messages)

参数名类型描述示例值
idstring语音标识7086bf2f0c2e944b15b08897277d8414
tostring接听人手机号 (E.164)+8618509872103
regionCodestring国际代码CN
countryCodestring国际电话区号86
messageCountinteger计费语音总条数1
statusstring发送状态sent
upstreamstring短信上游monyun.standard
pricestring消费金额0.050000

响应示例

成功响应示例

Status Code: 200, Response Body:

{ "data": { "recipients": 1, "messageCount": 1, "totalAmount": "0.050000", "payAmount": "0.050000", "virtualAmount": "0", "messages": [ { "id": "7086bf2f0c2e944b15b08897277d8414", "to": "+8618509872103", "regionCode": "CN", "countryCode": "86", "messageCount": 1, "status": "sent", "upstream": "monyun.standard", "price": "0.050000" } ] }, "code": "0", "message": "Success" }

失败响应示例

Status Code: 400, Response Body:

{ "code": "101301", "message": "未设置有效的上游服务商" }