https://graph.facebook.com/v21.0
/{whatsapp-business-account-ID}/message_templates
.
For more information on how to use the API, see WhatsApp Business Management API.
Retrieves information about the message template
Requirements
whatsapp_business_management permission
whatsapp_business_messaging permission
public_profile permission
WHATSAPP MESSAGE TEMPLATE ID
USER ACCESS TOKEN
Request
curl -i -X GET \
"https://graph.facebook.com/LATEST-VERSION/WHATS-APP-MESSAGE-TEMPLATE-ID?access_token=USER-ACCESS-TOKEN"
Response
{ "name": "shiptest", "components": [ { "type": "BODY", "text": "testing" } ], "language": "en_US", "status": "REJECTED", "category": "TRANSACTIONAL", "id": "WHATS-APP-MESSAGE-TEMPLATE-ID" }
字段 | 描述 |
---|---|
id numeric string | ID |
category enum | The category type of the message template |
components | An array of JSON objects describing the message template components. |
correct_category enum | The correct category for the template. |
cta_url_link_tracking_opted_out bool | Optional boolean field for opting out/in of link tracking at template level |
language string | The language (and locale) of the element translation |
library_template_name string | Template Library name that this HSM is clone from |
message_send_ttl_seconds integer |
Template message delivery retry time-to-live (TTL) override value. If we are unable to deliver a message to a WhatsApp user, we will retry the delivery for a period of time known as a time-to-live, TTL, or the message validity period.
|
name string | The message template name |
parameter_format enum | parameter_format |
previous_category enum | Previous category of the template. See Template Categories. |
quality_score | Quality score of the HSM |
rejected_reason enum | The reason the message template was rejected enum {ABUSIVE_CONTENT, INVALID_FORMAT, NONE, PROMOTIONAL, TAG_CONTENT_MISMATCH, SCAM} |
status enum | The status of the message template enum {APPROVED, IN_APPEAL, PENDING, REJECTED, PENDING_DELETION, DELETED, DISABLED, PAUSED, LIMIT_EXCEEDED} |
sub_category enum | Sub category of the template |
连线 | 描述 |
---|---|
Edge<WhatsAppBusinessHSMComparison> | compare |
错误 | 描述 |
---|---|
80008 | There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
100 | Invalid parameter |
104 | Incorrect signature |
190 | Invalid OAuth 2.0 Access Token |
message_templates
连线发出 POST 请求:参数 | 描述 |
---|---|
allow_category_change boolean | Set to
|
category enum {UTILITY, MARKETING, AUTHENTICATION} | Template category. See Template Categories. 必填 |
components array<JSON object> | Array of components that make up the template. See Template Components.
|
language string | Template location and locale code. 必填 |
library_template_body_inputs JSON object | Optional data during creation of a template from a library template. These are optional fields for the body component. |
library_template_button_inputs array<JSON object> | Optional data during creation of a template from a library template. These are optional fields for the button component. |
library_template_name string | library_template_name |
message_send_ttl_seconds int64 | Time to live for message template sent. If users are offline for more than TTL duration after message template is sent, we will retry the delivery for a period of time known as a time-to-live, TTL, or the message validity period. TTL can be configured for certain message types. See Time-To-Live. |
name string | Template name. 必填 |
parameter_format enum {NAMED, POSITIONAL} | The parameter format of the template |
sub_category enum {ORDER_DETAILS, ORDER_STATUS} | Sub category of the template |
id
: numeric string, status
: enum, category
: enum, 错误 | 描述 |
---|---|
100 | Invalid parameter |
192 | Invalid phone number |
131009 | Parameter value is not valid |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
80008 | There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
200 | Permissions error |
139002 | Publishing attempt failed |
190 | Invalid OAuth 2.0 Access Token |
/{whats_app_message_template_id}
发出 POST 请求,以更新 a WhatsAppMessageTemplate 。参数 | 描述 |
---|---|
category enum {UTILITY, MARKETING, AUTHENTICATION} | category |
components array<JSON object> | The array containing all the content of the message template |
message_send_ttl_seconds int64 |
Template message delivery retry time-to-live (TTL) override value.If we are unable to deliver a message to a WhatsApp user, we will retry the delivery for a period of time known as a time-to-live, TTL, or the message validity period. If we are unable to deliver the message for this period of time, the message will be dropped.
|
parameter_format enum {NAMED, POSITIONAL} | The parameter format of the template |
success
: bool, 错误 | 描述 |
---|---|
100 | Invalid parameter |
192 | Invalid phone number |
131009 | Parameter value is not valid |
368 | The action attempted has been deemed abusive or is otherwise disallowed |
/{whats_app_business_account_id}/message_templates
发出 DELETE 请求,将 a WhatsAppMessageTemplate 与 a WhatsAppBusinessAccount 取消关联。参数 | 描述 |
---|---|
hsm_id numeric string | ID of template to be deleted. Required if deleting a template by ID. |
name string | Name of template to be deleted. 必填 |
success
: bool, 错误 | 描述 |
---|---|
100 | Invalid parameter |
80008 | There have been too many calls to this WhatsApp Business account. Wait a bit and try again. For more info, please refer to https://developers.facebook.com/docs/graph-api/overview/rate-limiting. |
190 | Invalid OAuth 2.0 Access Token |