短信服务使用方可以调用ApplySmsTemplateV2SDK接口申请新的短信模板。
POSThttps://sms.volcengineapi.com/?Action=ApplySmsTemplateV2SDK&Version=2021-01-11名称 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
Action | String | 是 | ApplySmsTemplateV2SDK | 要执行的操作,取值:ApplySmsTemplateV2SDK |
Version | String | 是 | 2021-01-11 | API的版本,取值:2021-01-11 |
名称 | 类型 | 是否必填 | 示例值 | 描述 |
|---|---|---|---|---|
subAccounts | Array of String | 否 | ["2dhwher","2dhw234"] | 消息组ID集合,如果区分特定的消息组,需要填写,数组为空时针对全局创建 |
channelType | String | 是 | CN_OTP | 短信类型
|
name | String | 是 | cx_test | 模板名称 |
content | String | 是 | 你的验证码是${code} | 模板内容 |
desc | String | 否 | 用于发送注册验证码 | 模板用途 |
shortUrlConfig | shortUrlConfig | 否 | 当需要使用短链接配置时传入此参数 | |
signatures | Array of String | 是 | ["签名1","签名2"] | 关联的签名列表 |
templateParams | Array of Object | 否 | 模板中的参数类型 | |
templateTrafficDriving | Array of Objects | 否 | 模板中的参数的引流信息内容,是一个二维数组,具体参考json的case |
名称 | 类型 | 示例值 | 描述 |
|---|---|---|---|
ResponseMetadata | ResponseMetadata | 响应公共参数。 | |
Result | TemplateApplyResp | 响应业务参数。 |
{ "subAccounts":["6df8****"], "name":"cx_test", "channelType":"CN_NTC", "desc":"用于发送通知短信", "content":"通知短信,亲爱的用户${user},请联系人手机号${phone},详情请点击${url}", "signatures":["测试签名1","测试签名2"], "templateParams":[ { "name":"user", "paramType":1 }, { "name":"phone", "paramType":3 }, { "name":"url", "paramType":2 } ], "templateTrafficDriving":[ [ { "name":"phone", "paramType":3, "content":"188*******" }, { "name":"url", "paramType":2, "content":"douyin.com" } ], [ { "name":"phone", "paramType":3, "content":"188*******" }, { "name":"url", "paramType":2, "content":"douyin.com/123" } ] ] }
{ "ResponseMetadata":{ "RequestId":"2022090818181501017423503804EC****", "Action":"ApplySmsTemplateV2SDK", "Version":"2021-01-11", "Service":"volcSMS", "Region":"cn-north-1" }, "Result": { "templateId": "S1T_1y2p****", "secondTemplates": [ { "secondTemplateId": "S2T_1y2t*****", "signature": "爱看", "industry": "finance", "industryCn": "金融", "channelType": "CN_MKT", "content": "【爱看】测试营销短信,${phone1}, ${url}拒收请回复R" }, { "secondTemplateId": "S2T_1y2p******", "signature": "爱看", "industry": "educate", "industryCn": "教育", "channelType": "CN_MKT", "content": "【爱看】测试营销短信,${phone1}, ${url}拒收请回复R" } ] } }
{ "subAccounts":["6df8****"], "area":"cn", "name":"cx_test", "channelType":"CN_NTC", "desc":"用于发送通知短信", "content":"通知短信,亲爱的用户${user},请联系人手机号${phone},详情请点击${url}", "signatures":["测试签名1","测试签名2"], "templateParams":[ { "name":"user", "paramType":1 }, { "name":"phone", "paramType":3 }, { "name":"url", "paramType":2 } ], "templateTrafficDriving":[ [ { "name":"phone", "paramType":3, "content":"188*******" }, { "name":"url", "paramType":2, "content":"douyin.com" } ], [ { "name":"phone", "paramType":3, "content":"188*******" }, { "name":"url", "paramType":2, "content":"douyin.com/123" } ] ] }
{ "ResponseMetadata": { "RequestId":"2022090818181501017423503804EC****", "Action":"ApplySmsTemplateV2SDK", "Version":"2021-01-11", "Service":"volcSMS", "Region":"cn-north-1" "Error": { "Code": "1001", "Message": "请求参数错误" } } }
下表提供了该接口业务逻辑相关的错误码。公共错误码请参见公共错误码。
HttpCode | 错误码 | 错误信息 | 描述 |
|---|---|---|---|
200 | 1001 | 参数错误 | 参数错误 |
200 | 1999 | 系统错误 | 系统错误 |
200 | 1007 | template check failed | 模板申请时,校验失败 |