curl --location 'https://api.weya.live/backend/api/whatsapp/get-variable-by-template-id/6891f1d0c45d123456789abc/987654321' \
--header 'x-api-key: YOUR_API_KEY'
WhatsApp
Get Template Variables
Fetch the body and variables of one WhatsApp template, from AiSensy.
GET
/
api
/
whatsapp
/
get-variable-by-template-id
/
{phoneNumberId}
/
{templateId}
curl --location 'https://api.weya.live/backend/api/whatsapp/get-variable-by-template-id/6891f1d0c45d123456789abc/987654321' \
--header 'x-api-key: YOUR_API_KEY'
Overview
Fetch one template of one of your WhatsApp integrations live from AiSensy, to see which variables it needs. The data is whatever AiSensy returns for the template.Prerequisites
- An API key for your workspace
- The integration ID (
_idfrom Get WhatsApp Numbers) and a template ID from Get WhatsApp Templates
Request
curl --location 'https://api.weya.live/backend/api/whatsapp/get-variable-by-template-id/6891f1d0c45d123456789abc/987654321' \
--header 'x-api-key: YOUR_API_KEY'
Response
A successful request returnsstatus: true, the message Template fetched successfully, and the template in data.
Error Handling
Errors returnstatus: false, with the reason in errorMessage.
- 400 Bad Request –
Valid Phone Number ID and Template ID are required. - 401 Unauthorized – Missing or invalid API key.
- 404 Not Found –
Whatsapp number not found: it doesn’t exist or wasn’t connected by the user who owns the API key. - 429 Too Many Requests – More than 1,000 WhatsApp requests in 15 minutes from your IP address.
- 500 Internal Server Error – Unexpected server error, or AiSensy couldn’t be reached.
Was this page helpful?

