fbpx

< / >

APIs WhatsApp

6. List templates

https://wv{{wolkvox_server}}.wolkvox.com/api/v2/whatsapp.php?api=list_templates

 

Description:

This API allows you to retrieve a list of all WhatsApp message templates associated with a specific WhatsApp connector integrated into your operation. It is essential for administrators and developers who need an overview of the available templates, their approval status, languages, and components.

 

Benefits:

  • Complete Template Visibility: Enables users and systems to obtain a comprehensive list of all WhatsApp templates linked to a specific connector, including approval status and content details.
  • Centralized Management: Facilitates auditing and managing WhatsApp templates directly from Wolkvox Manager, without needing to access the Meta Business Suite platform to check their existence or status.
  • Workflow Automation: Allows other applications or automated processes to check the availability and status of templates in order to automate message delivery or campaign management.
  • Campaign Optimization: By knowing the status of templates (APPROVED, PENDING, REJECTED), marketing teams can plan and execute their WhatsApp campaigns more efficiently.
  • Troubleshooting: Helps diagnose issues related to templates that are not being sent, by quickly checking their status and configuration.

 

How it works:

  • This API is consumed using the GET method.
  • To use this API, replace {{wolkvox_server}} in the URL with the corresponding server name for your operation.
  • The wolkvox-token header must be included to authorize the request using your token.
  • Keep in mind that a single token cannot be used for simultaneous requests. You should schedule the next API call only after the previous one has completed successfully.

 

API Limits:

  • Maximum records to download per request: 60,000
  • Maximum records to upload per request: 10,000
  • Maximum date range per query: 31 days
  • Maximum response size: 256 MB
  • API timeout limit: 60 seconds
  • Simultaneous requests per token: 2
  • Daily token usage limit: Number of licenses × 1,000 daily tokens

 

Code Examples:

In our Postman workspace ([click here] to access it), you have access to code examples that facilitate integration with our APIs in different programming languages such as cURL, Python, JavaScript, and more.

This feature is ideal for quick integrations and allows you to adapt the API calls to your system’s programming language.

How to Use the Code Examples:

  1. Navigate to our Postman workspace.
  2. Select the API you want to consult.
  3. Edit the necessary API parameters according to your goals.
  4. In the “Code” tab, select your preferred programming language.
  5. You will get an auto-generated code snippet, ready to use with the parameters and authentication previously configured.

 

Request

NAMEDESCRIPTIONTYPE
connector_idThe identification number of the WhatsApp connector in your Wolkvox Manager operation from which you want to list the templates.String

Response

NAMEDESCRIPTIONTYPE
codeError code.Int
errorError name.String
msgError explanation.String
dataObject containing relevant upload data.Object
meta_templatesAn array of objects, where each object represents a WhatsApp template and its properties.String
nameThe unique name of the template.String
previous_categoryThe previous category of the template, if it has been modified.String
parameter_formatFormat of the template parameters.String
componentsArray describing the sections of the template.String
typeComponent type (e.g., “HEADER”, “BODY”, “FOOTER”, “BUTTONS”).String
formatMultimedia type if the header is multimedia (e.g., “IMAGE”, “DOCUMENT”, “VIDEO”).String
exampleContains content examples, such as header_handle (sample multimedia file URLs) or body_text (examples for body variables).String
textThe text content of the component.String
buttonsArray of objects describing the buttons (type, text, URL, flow_id, flow_action, Maps_screen for flows). The supported button types in Wolkvox are “URL”, “QUICK_REPLY”, “PHONE_NUMBER”, and “FLOW”. Learn more about button types by clicking [here].String
languageThe language code of the template. It must be one of the languages supported by Meta (see the full list by clicking [here]).String
status

The template’s status in Meta Business Suite. Possible values are:

“APPROVED”: The template has been reviewed and approved, ready for use.

“PENDING”: The template is under review.

“REJECTED”: The template was not approved.

String
categoryThe category of the template (e.g., “UTILITY”, “MARKETING”, “AUTHENTICATION”).String
sub_categoryTemplate subcategory, if applicable (e.g., “CUSTOM”, “FORM”).String
idThe unique ID of the template in Meta.String
templateNameThis field represents the template’s identifier name as managed internally in Wolkvox Manager. It functions as an alias or user-friendly name for the template within the Wolkvox ecosystem.String
plantillaThis field contains the body text of the template message. It presents the full message text, including variables, in a more direct and consolidated way.String
Possible Response Codes
				
					$curl = curl_init();

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://wv{{wolkvox_server}}.wolkvox.com/api/v2/whatsapp.php?api=list_templates',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'GET',
  CURLOPT_POSTFIELDS =>'{
    "connector_id": ""
}',
  CURLOPT_HTTPHEADER => array(
    'wolkvox-token: {{wolkvox-token}}',
    'Content-Type: application/json'
  ),
));

$response = curl_exec($curl);

curl_close($curl);
echo $response;

				
			

RESPONSE

				
					{
    "code": "200",
    "error": null,
    "msg": "Templates listed successfully",
    "data": {
        "meta_templates": [
            {
                "name": "",
                "previous_category": "",
                "parameter_format": "POSITIONAL",
                "components": [
                    {
                        "type": "",
                        "text": ""
                    },
                    {
                        "type": "BUTTONS",
                        "buttons": [
                            {
                                "type": "URL",
                                "text": "",
                                "url": ""
                            }
                        ]
                    }
                ],
                "language": "",
                "status": "",
                "category": "",
                "id": ""
            }
        ]
    }
}
				
			

Usamos cookies, se continuar a navegar assumimos que concorda. Pode ler mais sobre a utilização de cookies nas nossas políticas de privacidade e tratamento de dados pessoais

We use cookies, if you continue browsing we will assume that you agree. You can read more about the use of cookies in our privacy policies and treatment of personal data