发送语音验证码 API
共 1541字,需浏览 4分钟
·
2023-04-19 15:15
使用该接口发送语音验证码 (拨打电话) 至一个接收人。阅读本文档前请先阅读 API 通用说明。
接口定义
- 接口名:
sms.voice.verification.send - HTTP Method:
POST - Content-Type:
application/json
请求参数 (Body)
| 参数名 | 类型 | 是否必填 | 描述 | 示例值 |
|---|---|---|---|---|
| to | string | 是 | 接听人手机号 | 18509872103 |
| code | string | 是 | 验证码,为 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)
| 参数名 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| code | string | 返回码 | 101301 |
| message | string | 返回信息 | 未设置有效的上游服务商 |
| data | JSON | 返回结果 |
返回结果 (data)
| 参数名 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| status | string | 发送状态 | sent |
| recipients | integer | 接听人个数 | 1 |
| messageCount | integer | 计费语音总条数 | 1 |
| totalAmount | number | 总消费金额 | 0.05 |
| payAmount | number | 支付消费金额 | 0.05 |
| messages | JSON[] | 发送语音报告 |
发送语音报告 (data.messages)
| 参数名 | 类型 | 描述 | 示例值 |
|---|---|---|---|
| id | string | 语音标识 | 7086bf2f0c2e944b15b08897277d8414 |
| to | string | 接听人手机号 (E.164) | +8618509872103 |
| regionCode | string | 国际代码 | CN |
| countryCode | string | 国际电话区号 | 86 |
| messageCount | integer | 计费语音总条数 | 1 |
| status | string | 发送状态 | sent |
| upstream | string | 短信上游 | monyun.standard |
| price | string | 消费金额 | 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": "未设置有效的上游服务商"
}评论
