Get WhatsApp Message Templates
Retrieve the information and content of WhatsApp message templates that have been synchronized to the PBX for a specified WhatsApp channel.
Request URL
GET {base_url}/{api_path}/message_channel/whatsapp_template?access_token={access_token}
Request parameters
| Parameter | Required | Type | Description |
|---|---|---|---|
| omnichannel_id | Yes | Integer | The ID of the desired WhatsApp message channel. Note: You can query the ID using Search Specific Message Channels. |
| category | No | String | Template category. Valid value:
Note: Use a comma to separate
multiple categories. |
| language | No | String | Template language. Note:
|
| search_value | No | String | Search keyword. |
| page | No | Integer | Define which page is displayed. |
| page_size | No | Integer | Define how many records per page. |
Response parameters
| Parameter | Type | Description |
|---|---|---|
| errcode | Integer | Returned error code.
Note: You can check the error code and
error message in Error Code and Error Message.
|
| errmsg | String | Returned message.
|
| total_number | Integer | The total number of WhatsApp message templates. |
| data | Array <MSGTemplate_Info> | The detailed information of WhatsApp message templates. |
- MSGTemplate_Info
-
Parameter Type Description id Integer The ID of the message template in the PBX system. template_id String The original template ID from the WhatsApp platform. name String Template name. parameter_format String The format of the placeholders (variables) used in the template. POSITIONAL: Placeholders are defined by their position. For example,{{1}},{{2}}.NAMED: Placeholders use custom field names. For example,{{name}},{{code}}.
language String Template language. category String Template category. sub_category String Template sub-category. components_data String The content of template components in JSON string format. omnichannel_id Integer The ID of the message channel.
Example
Request example
GET /openapi/v1.0/message_channel/whatsapp_template?omnichannel_id=1&access_token=FOgrNFKY6xVQcUxw3pfMTFqCAG6lBulV&search_value=store HTTP/1.1
Host: 192.168.5.150:8088
Response example
HTTP/1.1 200 OK
{
"errcode": 0,
"errmsg": "SUCCESS",
"total_number": 1,
"data": [
{
"id": 1774,
"template_id": "2011532696320970",
"name": "store_offer_notification",
"parameter_format": "NAMED",
"language": "en",
"category": "MARKETING",
"sub_category": "CUSTOM",
"components_data": "[{\"type\":\"HEADER\",\"format\":\"LOCATION\"},{\"type\":\"BODY\",\"text\":\"Special offer: {{Offer_Details}}\\n\\nPlease visit our store within {{Time_Limit}} to enjoy this offer.\\n\\nIf you have any questions, feel free to contact us.\"},{\"type\":\"FOOTER\",\"text\":\"We look forward to serving you!\"}]",
"omnichannel_id": 1
}
]
}