更新时间:2024-01-17 GMT+08:00
分享

查询短信模板

功能介绍

该接口用于用户查询已创建的模板信息。

调试

您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。

URI

GET /v2/{project_id}/msgsms/templates

表1 路径参数

参数

是否必选

参数类型

描述

project_id

String

项目ID,参考“获取帐号、用户、项目的名称和ID

表2 Query参数

参数

是否必选

参数类型

描述

app_key

String

应用key

app_name

String

应用名称

end_time

String

结束时间

flow_status

String

流程状态

  • Adopted:通过
  • Reviewing:审核中
  • Reject:拒绝

has_variable

String

是否存在变量

limit

Integer

数量,默认值10

offset

Integer

偏移量

sign_name

String

签名名称

sort_dir

String

排序方式

  • desc:降序
  • asc:升序

sort_key

String

排序字段,仅支持create_time

start_time

String

开始时间

template_id

String

模板ID

template_name

String

模板名称

template_type

String

模板类型

  • VERIFY_CODE_TYPE:验证码类
  • PROMOTION_TYPE:推广类
  • NOTIFY_TYPE:通知类

region

String

地域

1. cn:国内

2. intl:国际

请求参数

表3 请求Header参数

参数

是否必选

参数类型

描述

Content-Type

String

请求体参数类型,该字段必须设置为:application/json

X-Auth-Token

String

用户Token。通过调用IAM服务获取用户Token接口获取(响应消息头中X-Subject-Token的值)

响应参数

状态码: 200

表4 响应Body参数

参数

参数类型

描述

results

Array of SmsTemplateResp

查询结果

total

Long

总数

表5 SmsTemplateResp参数

参数

是否必选

参数类型

描述

id

String

模板主键ID,用于获取、修改、删除模板以及查询模板变量的唯一标识

create_time

String

创建时间[yyyy-MM-dd HH:mm:ss]

update_time

String

更新时间[yyyy-MM-dd HH:mm:ss]

customer_id

String

租户customer id

tenant

TentantBasic

-

template_name

String

模板名称

template_id

String

模板ID

template_type

String

模板类型

app_name

String

应用名称

app_key

String

应用key

sign_id

String

签名id

template_content

String

模板内容

has_variable

String

是否有变量

template_desc

String

申请描述

review_desc

String

审核意见

review_order

String

审核人账号

flow_status

String

流程状态

universal_template

Integer

是否是通用模板

status

String

模板状态

  • Test:测试
  • Normal:正常

region

String

地域

  • cn:国内
  • intl:国际

brackets

String

中括号类型。支持枚举值:

  • CN:中文类型:【】
  • GB:英文类型: []
    须知:
    • 默认值为:CN
    • 输入值不在上述枚举值范围内的,也按CN处理。
    • 只有地域为国内时,该字段有效。

site

String

地域,取值范围:cn及hk ,当前该参数暂时不使用

urge_status

String

催审状态

urge_time

String

催审时间

urge_desc

String

催审描述

send_country1

Integer

发送国家1

send_country2

Integer

发送国家2

send_country3

Integer

发送国家3

is_support_multiomp

boolean

是否支持多OMP

country_name

String

国家名称列表,返回发送国家前三名的国家名称,国家名称间以"~"分隔

请求示例

查询短信模板,请求方式:GET ,请求URL:/v2/{project_id}/msgsms/templates,路径参数:project_id,请求头参数:X-Auth-Token,Content-Type;Query参数:limit,offset,app_key,region。

GET /v2/845ada5bc7444f1295cd517af0123da1/msgsms/templates?template_name=auto_test789 
Host: 100.85.***.***:30300
Content-Type: application/json
X-Auth-Token: ****

响应示例

{
    "results": [
        {
            "create_time": "2022-08-12 07:40:36",
            "customer_id": "******c55c3c4526b2ed7a0213bc9871",
            "id": "******27-37eb-4229-bee9-0eba4d8a897f",
            "template_type": "NOTIFY_TYPE",
            "template_name": "auto_test789",
            "app_key": "******3baZf4c856O4Qrbqvui3K2",
            "sign_id": "******b9-4141-4e2d-9838-14889c32a4bf",
            "template_content": "测试",
            "has_variable": "No",
            "flow_status": "Reviewing",
            "status": "Normal",
            "universal_template": 0,
            "urge_status": "NO",
            "country_name": ""
        }
    ],
    "total": 1
}

返回值

返回值

描述

200

OK

401

Unauthorized

403

Forbidden

404

Not Found

500

System error

分享:

    相关文档

    相关产品