fbpx

< / >

APIs WhatsApp

9. Synchronize templates

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

 

Description

This API allows you to synchronize existing message templates from a WhatsApp connector (i.e., those approved in your Meta Business Manager account) directly with your operation’s integration in Wolkvox Manager. This functionality ensures that all your approved templates are available and up to date within the Wolkvox platform, facilitating their use in campaigns and communication flows.

 

Benefits

  • Automatic Template Availability: Ensures all templates approved in Meta are automatically available in Wolkvox Manager, with no manual intervention required.
  • Operational Efficiency: Reduces time and effort in managing templates by centralizing their administration and maintaining consistency across platforms.
  • Communication Consistency: Guarantees that the templates used in your WhatsApp campaigns are always updated with the latest versions approved in Meta.
  • Simplified Flows: Eases the implementation of automated message flows in Wolkvox by providing immediate access to all necessary templates.
  • Error Reduction: Minimizes human errors related to manually creating duplicate or outdated templates.

 

How it works:

  • This API is consumed using the POST method.
  • To use this API, replace {{wolkvox_server}} in the URL with your operation’s server nomenclature.
  • The wolkvok-token header must be used to provide the authorization token.
  • Keep in mind that a single token cannot be consumed simultaneously, so you should program the next API call to execute only after a successful result from the previous one.
  • Record download limit per request: 60,000 records.
  • Record upload limit per request: 10,000 records.
    Date range query limit: 31 days.
  • Response size limit: 256 MB.
  • API timeout limit: 60 seconds.
  • Simultaneous token usage limit: 2 concurrent requests.
  • Daily token limit: Number of licenses multiplied by 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 unique identification number of the WhatsApp connector integrated into your Wolkvox Manager operation. This ID is essential for the API to determine from which WhatsApp Business account the templates should be synchronized.String

Response

NAMEDESCRIPTIONTYPE
codeError code.Int
errorError name.String
msgError explanation.String
dataObject containing the relevant payload data.Object
name_templateThe name of the template as registered in Meta and Wolkvox.String
body_templateThe full body text of the template, including variables (e.g., {{1}}, {{2}}).String
idiomThe template’s language code (e.g., “es”, “en_US”, “es_MX”). To view all supported language codes, refer to the official Meta Business documentation by clicking [here].String
categoryThe category the template belongs to according to Meta’s guidelines (e.g., “MARKETING”, “UTILITY”, “AUTHENTICATION”, “FLOW”).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=sync_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 => 'POST',
  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 synced successfully",
    "data": [
        {
            "name_template": "",
            "body_template": "",
            "idiom": "",
            "category": ""
        }
    ]
}
				
			

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