Logo Site EngageLab Mark Colored Transparent文档
搜索

获取模板配置详情

根据模板 ID 获取模板配置的详细信息,包含模板名称、类型、内容、审核状态等。

调用地址

GET https://smsapi.engagelab.com/v1/template-configs/:templateId

调用验证

请参考 调用验证 了解如何进行 API 鉴权。

请求示例

请求头

GET /v1/template-configs/123456789 HTTP/1.1 Content-Type: application/json Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
              
              GET /v1/template-configs/123456789  HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0

            
此代码块在浮窗中显示

请求体

请求参数

路径参数

参数 类型 选项 说明
templateId String 必填 模板 ID

返回参数

成功返回

http 状态码为 200,响应体为模板配置对象:

字段 类型 描述
template_id String 模板 ID
template_name String 模板名称
template_type String 模板类型:utility(通知类)、marketing(营销类)
template_content String 模板内容
country_codes String 主要发送国家代码,逗号分隔
status Integer 状态:1-待审核,2-审核通过,3-审核拒绝
sign_id String 签名 ID(可选)
sign_name String 签名名称(可选)
sign_position Integer 签名位置:0-无,1-前缀,2-后缀(可选)
sign_status Integer 签名状态(可选)
audit_remark String 审核备注
created_time Integer 创建时间(Unix 时间戳)
updated_time Integer 更新时间(Unix 时间戳)

成功示例

{ "template_id": "123456789", "template_name": "订单通知模板", "template_type": "utility", "template_content": "您的订单{order_no}已发货,预计{delivery_time}送达", "country_codes": "CN,US", "status": 2, "sign_id": "987654321", "sign_name": "公司名称", "sign_position": 2, "sign_status": 2, "audit_remark": "", "created_time": 1699000000, "updated_time": 1699000000 }
              
              {
  "template_id": "123456789",
  "template_name": "订单通知模板",
  "template_type": "utility",
  "template_content": "您的订单{order_no}已发货,预计{delivery_time}送达",
  "country_codes": "CN,US",
  "status": 2,
  "sign_id": "987654321",
  "sign_name": "公司名称",
  "sign_position": 2,
  "sign_status": 2,
  "audit_remark": "",
  "created_time": 1699000000,
  "updated_time": 1699000000
}

            
此代码块在浮窗中显示

失败返回

http 状态码为 4xx/5xx,响应体包含字段如下:

字段 类型 描述
code Integer 错误码
message String 错误详情

异常示例

{ "code": 400, "message": "invalid templateId" }
              
              {
  "code": 400,
  "message": "invalid templateId"
}

            
此代码块在浮窗中显示

错误码

错误码 http code 说明
400 400 参数错误或业务逻辑错误
500 500 服务器内部错误

常见错误信息:

  • invalid templateId:模板 ID 格式错误
  • template config not exist:模板配置不存在

附录

模板配置状态 (status)

说明
1 待审核
2 审核通过
3 审核拒绝

模板类型 (template_type)

说明
utility 通知类
marketing 营销类
Icon Solid Transparent White Qiyu
联系销售