取得範本設定列表
取得當前業務下的所有範本設定列表,回傳包含範本名稱、類型、內容、審核狀態等資訊的列表。
呼叫位址
GET https://smsapi.engagelab.com/v1/template-configs
呼叫驗證
請參考 呼叫驗證 了解如何進行 API 驗證。
請求範例
請求標頭
GET /v1/template-configs HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
GET /v1/template-configs HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
此代碼塊在浮窗中顯示
請求主體
無
請求參數
無
回傳參數
成功返回
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": 500,
"message": "伺服器內部錯誤"
}
{
"code": 500,
"message": "伺服器內部錯誤"
}
此代碼塊在浮窗中顯示
錯誤碼
| 錯誤碼 | http code | 說明 |
|---|---|---|
| 400 | 400 | 參數錯誤或業務邏輯錯誤 |
| 500 | 500 | 伺服器內部錯誤 |
附錄
範本設定狀態 (status)
| 值 | 說明 |
|---|---|
| 1 | 待審核 |
| 2 | 審核通過 |
| 3 | 審核拒絕 |
範本類型 (template_type)
| 值 | 說明 |
|---|---|
| utility | 通知類 |
| marketing | 行銷類 |










