发送aim智慧短信
一次调用中最多支持设置 200 个手机号
当传入多个手机号时,部分错误码将通过回执返回
请求方式: POST
请求地址: https://sms.volcengineapi.com?Action=SendAim&Version=2020-01-01
下表仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。
const columns = [
{
title: '参数',
dataIndex: 'Name',
},
{
width: '9%',
title: '类型',
dataIndex: 'DataType',
},
{
width: '9%',
title: '是否必填',
dataIndex: 'IsRequired',
},
{
width: '18%',
title: '示例值',
dataIndex: 'Example',
},
{
width: '55%',
title: '描述',
dataIndex: 'Description',
},
];
const data = [
{
rowKey: '->Action',
Name: 'Action',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"SendAim"} />,
Description: <RenderMd content={"要执行的操作,取值:SendAim。"} />,
children: [
]
},
{
rowKey: '->Version',
Name: 'Version',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"2020-01-01"} />,
Description: <RenderMd content={"API的版本,取值:2020-01-01。"} />,
children: [
]
},
{
rowKey: '->Cn5GAimExtraParams',
Name: 'Cn5GAimExtraParams',
DataType: 'Cn5GAimExtraParams',
IsRequired: '是',
Example: <RenderMd content={" "} />,
Description: <RenderMd content={"智慧短信发送时,额外的降级需要的参数"} />,
children: [
{
rowKey: '->Cn5GAimExtraParams->DegradeType',
Name: 'DegradeType',
DataType: 'Integer',
IsRequired: '是',
Example: <RenderMd content={"1"} />,
Description: <RenderMd content={"降级类型 : 0:不降级,1:降级视频短信,2:降级普通文本短信,默认值是 0。"} />,
children: [
]
},
{
rowKey: '->Cn5GAimExtraParams->DegradeTemplateId',
Name: 'DegradeTemplateId',
DataType: 'String',
IsRequired: '否',
Example: <RenderMd content={"ST_6f8c****\n"} />,
Description: <RenderMd content={"降级模板Id: 降级类型为0时,该字段不生效;降级类型为1时,该字段传入视频短信模板ID,如果不传会使用申请智慧短信模板时设置的视频短信降级模板ID;降级类型为2时,该字段传入文本短信模板ID,如果不传会使用申请智慧短信模板时设置的文本短信降级模板ID。"} />,
children: [
]
},
{
rowKey: '->Cn5GAimExtraParams->DegradeSign',
Name: 'DegradeSign',
DataType: 'String',
IsRequired: '否',
Example: <RenderMd content={"短信服务\n"} />,
Description: <RenderMd content={"降级签名 降级类型为 0时,该字段不生效,可不填。 降级类型为 1或2时,参数必填(注:如果降级类型为视频短信降级则需要与视频短信模板的签名保持一致)"} />,
children: [
]
},
{
rowKey: '->Cn5GAimExtraParams->DegradeTemplateParam',
Name: 'DegradeTemplateParam',
DataType: 'String',
IsRequired: '否',
Example: <RenderMd content={"{\"code\":\"1234\"}\n"} />,
Description: <RenderMd content={"降级模板对应的动态参数 当降级类型不为0且指定降级消息的模板D存在变量时,您需要设置变量的实际值。变量的个数需要和申请时的模板保持一致,格式示例:{\\\"code1\\\":\\\"1234\\\", \\\"code2\\\":\\\"5678\\\"}\""} />,
children: [
]
},
]
},
{
rowKey: '->SmsAccount',
Name: 'SmsAccount',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"A123****\n"} />,
Description: <RenderMd content={"消息组 ID。\n"} />,
children: [
]
},
{
rowKey: '->Sign',
Name: 'Sign',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"短信服务\n"} />,
Description: <RenderMd content={"对应的原文短信签名。需要和申请时智慧短信模板 ID的模板对应的签名保持一致"} />,
children: [
]
},
{
rowKey: '->TemplateID',
Name: 'TemplateID',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"5G_6f8c****\n"} />,
Description: <RenderMd content={"智慧短信模板 ID"} />,
children: [
]
},
{
rowKey: '->TemplateParam',
Name: 'TemplateParam',
DataType: 'String',
IsRequired: '否',
Example: <RenderMd content={"{\"code\":\"1234\"}\n"} />,
Description: <RenderMd content={"当指定的短信模板(TemplateID)存在变量时,您需要设置变量的实际值。支持传入一个或多个参数,格式示例:{\"code1\":\"1234\", \"code2\":\"5678\"}。\n"} />,
children: [
]
},
{
rowKey: '->PhoneNumbers',
Name: 'PhoneNumbers',
DataType: 'String',
IsRequired: '是',
Example: <RenderMd content={"188********\n"} />,
Description: <RenderMd content={"短信发送的目标手机号。配置说明: 最多支持设置 200 个手机号码,多个号码之间使用英文逗号(,)间隔。 如果您设置的是中国大陆手机号,则国际区号为可选项。例如+86188********和188********都是合法的手机号码。 如果您设置的是非中国大陆手机号,则国际区号为必填项,且格式需符合 E.164 标准。"} />,
children: [
]
},
{
rowKey: '->Tag',
Name: 'Tag',
DataType: 'String',
IsRequired: '否',
Example: <RenderMd content={"123456\n"} />,
Description: <RenderMd content={"透传字段。这个字段用于关联发送请求和短信回执,在回传回执消息的时候,会将该字段原样返回给服务使用方。例:如果你在短信发送请求的 Tag 中传了一个唯一的 ID,在短信回执的 ext 参数中会把这个 ID 也原样返回给调用方。\n"} />,
children: [
]
},
];
return (<Table
rowKey="rowKey"
className="openapi-doc-parameter-table"
columns={columns}
data={data}
border={ { cell: true, wrapper: true } }
pagination={false}
/>);
下表仅列出本接口特有的返回参数。更多信息请参见返回结构。
const columns = [
{
title: '参数',
dataIndex: 'Name',
},
{
title: '类型',
dataIndex: 'DataType',
width: '10%',
},
{
title: '示例值',
dataIndex: 'Example',
width: '20%',
},
{
title: '描述',
dataIndex: 'Description',
width: '60%',
},
];
const data = [
{
rowKey: "->ResponseMetadata",
Name: "ResponseMetadata",
DataType: "ResponseMetadata",
Example: <RenderMd content={" "} />,
Description: <RenderMd content={"响应公共参数。\n"} />,
children: [
{
rowKey: "->ResponseMetadata->RequestId",
Name: "RequestId",
DataType: "String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"请求ID"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Action",
Name: "Action",
DataType: "String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"请求方法"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Version",
Name: "Version",
DataType: "String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"请求API版本"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Service",
Name: "Service",
DataType: "String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"Service"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Region",
Name: "Region",
DataType: "String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"Region"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Error",
Name: "Error",
DataType: "Error",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"错误信息"} />,
children: [
{
rowKey: "->ResponseMetadata->Error->Code",
Name: "Code",
DataType: 'String',
Example: <RenderMd content={""} />,
Description: <RenderMd content={"错误码"} />,
children: [
]
},
{
rowKey: "->ResponseMetadata->Error->Message",
Name: "Message",
DataType: 'String',
Example: <RenderMd content={""} />,
Description: <RenderMd content={"错误描述"} />,
children: [
]
},
]
},
]
},
{
rowKey: "->Result",
Name: "Result",
DataType: "SendResult",
Example: <RenderMd content={" "} />,
Description: <RenderMd content={"响应的消息 ID。 手机号解析成功:返回多条消息ID。每条消息 ID 对应一个手机号的请求,其中展示顺序为传入电话号码的顺序; 手机号解析失败:只返回一条消息ID。\n"} />,
children: [
{
rowKey: "->Result->MessageID",
Name: "MessageID",
DataType: "Array of String",
Example: <RenderMd content={""} />,
Description: <RenderMd content={"响应的消息 ID。"} />,
children: [
]
},
]
},
];
return (<Table
rowKey="rowKey"
className="openapi-doc-parameter-table"
columns={columns}
data={data}
border={ { cell: true, wrapper: true } }
pagination={false}
/>);
{
"SmsAccount": "A123***",
"Sign": "短信服务",
"TemplateID": "5G_****",
"TemplateParam": "{\"code\":\"1234\"}",
"PhoneNumbers": "188********",
"Tag": "",
"Cn5GAimExtraParams": {
"DegradeType": 1,
"DegradeTemplateId": "VT_7c****",
"DegradeSign": "短信服务",
"DegradeTemplateParam": "{\"code\":\"1234\"}"
}
}
{
"ResponseMetadata": {
"RequestId": "20240509173046776B1E94********",
"Action": "SendAim",
"Version": "2020-01-01",
"Service": "volcSMS",
"Region": "cn-north-1",
},
"Result": {
"MessageID": [
"fcfefde9-10d2-484d-8802-d442df******"
]
}
}
下表为您列举了该接口与业务逻辑相关的错误码。公共错误码请参见公共错误码文档。
const columns = [
{
title: '状态码',
dataIndex: 'HttpCode',
width: '9%',
},
{
title: '错误码',
dataIndex: 'ErrorCode',
width: '13%',
},
{
title: '错误信息',
dataIndex: 'ErrorMessage',
width: '39%',
},
{
title: '说明',
dataIndex: 'Description',
width: '39%',
},
];
const data = [
{
HttpCode: 200,
ErrorCode: 'VE:0001',
ErrorMessage: "账户不允许发送视频短信",
Description: <RenderMd content={"请检查当前AccessKey是否已经开通视频短信服务。如已开通视频短信服务,则参照视频短信务文档调用接口。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0001',
ErrorMessage: "账号短信服务未开通",
Description: <RenderMd content={"请检查当前AccessKey是否已经开通短信服务。如已开通[短信服务](https://www.volcengine.com/product/cloud-sms),则参照短信服务文档调用接口。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0002',
ErrorMessage: "账号被关停",
Description: <RenderMd content={"请联系火山引擎客服确认"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0003',
ErrorMessage: "子账号不存在",
Description: <RenderMd content={"请填写正确的SmsAccount,即[消息组ID](https://console.volcengine.com/sms/subaccount/list)"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0004',
ErrorMessage: "签名错误",
Description: <RenderMd content={"请确认对应SmsAccount下是否存在该签名,或登录[短信服务控制台](https://console.volcengine.com/sms),在**短信签名**页面查询此签名是否审核通过。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0005',
ErrorMessage: "模板错误",
Description: <RenderMd content={"请检查对应SmsAccount下是否存在该模板,或登录[短信服务控制台](https://console.volcengine.com/sms),在**短信模板**页面查询此模板是否审核通过。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0006',
ErrorMessage: "手机号格式错误",
Description: <RenderMd content={"手机号参数请传入正确的格式。\n- 国内消息:+86或无任何前缀的11位手机号码,例如1580799\\*\\*\\*\\* \n- 国际/港澳台消息:国际区号为必填项,且格式需符合 E.164 标准。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0007',
ErrorMessage: "IP校验错误",
Description: <RenderMd content={"已开启IP白名单,请联系火山引擎客服确认当前IP是否已加白。"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0009',
ErrorMessage: "请求参数错误",
Description: <RenderMd content={"请根据接口文档检查参数是否正确"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0000',
ErrorMessage: "账号鉴权失败",
Description: <RenderMd content={"请检查参数是否使用正确或参考SDK内的鉴权处理"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0011',
ErrorMessage: "不支持对应地区下发",
Description: <RenderMd content={"请在允许的地区内进行下发或者申请对应地区的短信下发"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0012',
ErrorMessage: "不支持的发送类型",
Description: <RenderMd content={"请登录控制台,在消息组列表点击编辑,检查允许发送的短信类型是否勾选"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0013',
ErrorMessage: "发送量超阈值",
Description: <RenderMd content={"发送量超阈值,请检查控制台发送上限设置"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0500',
ErrorMessage: "未知交互类错误",
Description: <RenderMd content={"请尝试重新调用接口"} />,
},
{
HttpCode: 200,
ErrorCode: 'VE:0004',
ErrorMessage: "当前模板已过期",
Description: <RenderMd content={"请重新申请新模板"} />,
},
{
HttpCode: 200,
ErrorCode: 'VE:0003',
ErrorMessage: "签名和申请模板时不一致",
Description: <RenderMd content={"请确保使用的签名和报备模板时保持一致"} />,
},
{
HttpCode: 200,
ErrorCode: 'VE:0002',
ErrorMessage: "视频短信模板不可用",
Description: <RenderMd content={"请确认对应的模板是否审核通过或允许使用"} />,
},
{
HttpCode: 200,
ErrorCode: 'RE:0010',
ErrorMessage: "账号欠费",
Description: <RenderMd content={"请登录控制台费用中心查询余额是否充足"} />,
},
{
HttpCode: 200,
ErrorCode: 'GE:0003',
ErrorMessage: "签名和申请模板时不一致",
Description: <RenderMd content={"请确保使用的签名和报备模板时保持一致"} />,
},
{
HttpCode: 200,
ErrorCode: 'GE:0001',
ErrorMessage: "账户不允许发送智慧短信",
Description: <RenderMd content={"请检查当前AccessKey是否已经开通智慧短信服务。如已开通智慧短信服务,则参照视频短信务文档调用接口。"} />,
},
{
HttpCode: 200,
ErrorCode: 'GE:0002',
ErrorMessage: "智慧短信模板不可用",
Description: <RenderMd content={"请确认对应的模板是否审核通过或允许使用"} />,
},
];
return (<Table
columns={columns}
data={data}
border={ { cell: true, wrapper: true } }
pagination={false}
/>);