テンプレート設定の更新
既存のテンプレート設定を更新し、テンプレート名、種別、内容、配信先国、署名情報の変更に対応します。更新後、テンプレートのステータスは「審査待ち」に戻ります。
リクエストURL
PUT https://smsapi.engagelab.com/v1/template-configs/:templateId
呼び出し認証
APIリクエストの認証方法については、呼び出し認証を参照してください。
リクエスト例
リクエストヘッダー
PUT /v1/template-configs/123456789 HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
PUT /v1/template-configs/123456789 HTTP/1.1
Content-Type: application/json
Authorization: Basic amlndWFuZ2RldjpkZXZfc2VjcmV0
このコードブロックはフローティングウィンドウ内に表示されます
リクエストボディ
{
"template_name": "Order Notification Template",
"template_type": "utility",
"template_content": "Your order {order_no} has been shipped and is expected to be delivered by {delivery_time}",
"country_codes": "CN,US",
"add_signature": true,
"sign_id": "987654321",
"sign_position": 2
}
{
"template_name": "Order Notification Template",
"template_type": "utility",
"template_content": "Your order {order_no} has been shipped and is expected to be delivered by {delivery_time}",
"country_codes": "CN,US",
"add_signature": true,
"sign_id": "987654321",
"sign_position": 2
}
このコードブロックはフローティングウィンドウ内に表示されます
リクエストパラメータ
パスパラメータ
| パラメータ | 型 | 区分 | 説明 |
|---|---|---|---|
| templateId | String | 必須 | テンプレートID |
リクエストボディパラメータ
| パラメータ | 型 | 区分 | 説明 |
|---|---|---|---|
| template_name | String | 必須 | テンプレート名。最大255文字 |
| template_type | String | 必須 | テンプレート種別:utility(通知)、marketing(マーケティング) |
| template_content | String | 必須 | テンプレート内容。次の文字は使用不可:【、】、、、测试、test、[、] |
| country_codes | String | 必須 | 主な配信先の国コード。カンマ区切り |
| add_signature | Boolean | 任意 | 署名を追加するかどうか。デフォルトはfalse |
| sign_id | String | 条件付き必須 | add_signatureがtrueの場合は必須。署名ID |
| sign_position | Integer | 条件付き必須 | add_signatureがtrueの場合は必須。署名の位置:1-先頭、2-末尾 |
レスポンスパラメータ
成功レスポンス
HTTPステータスコードは200で、レスポンスボディには次のフィールドが含まれます。
| フィールド | 型 | 説明 |
|---|---|---|
| code | Integer | ステータスコード。0は成功を示す |
| message | String | ステータスの説明 |
成功例
{
"code": 0,
"message": "success"
}
{
"code": 0,
"message": "success"
}
このコードブロックはフローティングウィンドウ内に表示されます
エラーレスポンス
HTTPステータスコードは4xx/5xxで、レスポンスボディには次のフィールドが含まれます。
| フィールド | 型 | 説明 |
|---|---|---|
| code | Integer | エラーコード |
| message | String | エラーの詳細 |
エラー例
{
"code": 400,
"message": "can not update pending status template"
}
{
"code": 400,
"message": "can not update pending status template"
}
このコードブロックはフローティングウィンドウ内に表示されます
エラーコード
| エラーコード | HTTPコード | 説明 |
|---|---|---|
| 400 | 400 | パラメータエラーまたは業務ロジックエラー |
| 500 | 500 | サーバー内部エラー |
よくあるエラーメッセージ:
invalid templateId:テンプレートIDの形式エラーtemplate config not exist:テンプレート設定が存在しませんcan not update pending status template:審査待ちステータスのテンプレートは更新できませんthere are pending or running plans using current template, can not update:このテンプレートを使用している審査待ちまたは実行中のプランがあるため、更新できませんsign config not exist:署名設定が存在しませんsign status is not approved, can not use:署名のステータスが承認済みでないため、使用できません
注意事項
- 「審査待ち」ステータスのテンプレートは更新できません。
- このテンプレートを使用している審査待ちまたは実行中のメッセージプランがある場合は、更新できません。
- 更新後、テンプレートのステータスは「審査待ち」(status=1)に戻ります。
- 署名を追加する場合、その署名は承認済みのステータスである必要があります。
- テンプレート内容には禁止文字を含めることはできません:
【、】、、、测试、test、[、] - テンプレートIDと署名IDはいずれも文字列型の数値です。
付録
テンプレート設定のステータス(status)
| 値 | 説明 |
|---|---|
| 1 | 審査待ち |
| 2 | 承認済み |
| 3 | 却下 |
テンプレート種別(template_type)
| 値 | 説明 |
|---|---|
| utility | 通知 |
| marketing | マーケティング |
署名の位置(sign_position)
| 値 | 説明 |
|---|---|
| 0 | 署名なし |
| 1 | 先頭 |
| 2 | 末尾 |










