Get WhatsApp Template Status
GET Method
Kaleyra.io offers an API that enables you to get the current WhatsApp template status for a name-specific template OR you can get the current WhatsApp templates status for all the templates associated with your SID.
You can view the following WhatsApp statuses:
- Approved - For the approved WhatsApp template.
- Rejected - For the rejected WhatsApp template.
- Pending - For the pending WhatsApp template.
- Submission Rejected - When meta does not accept the WhatsApp template request from Kaleyra because it does not fulfill the criteria defined by them.
Base URL
To get the WhatsApp template status, perform the following:
Signup or Login to Kaleyra.io and Create your API key
Refer to the Create an API Key page for steps to create your API key. To view the API Key and the SID, see View API Key and SID.
Note:
After you sign up, your account will be on the trial version. You must complete the KYC to access all the features in Kaleyra.io.
API Request to get WhatsApp Templates
To get the WhatsApp template status, use the endpoints with the following request method:
Request Format for a name-specific template status
curl --location --request GET '{{url}}/v1/{{SID}}/whatsapp/templates/status?name={{TEMPLATE_NAME}}' \
--header 'api-key: {{API_KEY}}'
Request Format for all the templates statutes based on SID
curl --location --request GET '{{url}}/v1/{{SID}}/whatsapp/templates/status' \
--header 'api-key: {{API_KEY}}'
Note:
If you want to get the status (template name, template status, and date of template creation) of all the WhatsApp templates associated with your SID remove the
?name={{TEMPLATE_NAME}}
endpoint and send the request. For a successful response, you will get the response with all the WhatsApp template statuses.
The following table displays the parameter used to get WhatsApp template status API:
Parameter | Data Type | Description | Example | Mandatory |
---|---|---|---|---|
sid | String | Account SID (Security Identifier). | HXXXXXXX071US | Yes |
name | String | Template name for which you want to know the WhatsApp template statuses. | BXXBXXD_Sale | Yes (For a name-specific template) else No |
api-key | String | API key generated from Kaleyra.io account. | Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3 | Yes |
Sample Request Method
Sample Request for a name-specific template status
The following sample is the request method to get WhatsApp template status using name-specific:
curl --location --request GET 'https://api.kaleyra.io/v1/HXXXXXXX071US/whatsapp/templates/status?name={{BXXBXXD_Sale}}' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3'
Sample Request for all the templates statutes based on SID
The following sample is the request method to get WhatsApp template statuses based on SID:
curl --location --request GET 'https://api.kaleyra.io/v1/HXXXXXXX071US/whatsapp/templates/status' \
--header 'api-key: Axxxxxxxxxxxxxxxxxxxxxxxxxxxx3'
Sample Success Response
Sample success response for a name-specific template
The following success message appears with status 200, you can view the template name, template status, and date of template creation:
{
"code": "200",
"message": "Request successfully executed!",
"data": {
"name": "BXXBXXD_Sale",
"status": {
"id": "1",
"name": "Approved"
},
"created_at": "1675182226"
},
"error": [],
"total": 1,
"limit": 25,
"offset": 0
}
Sample success response for all the templates statutes based on SID
The following success message appears with status 200, you can view the template name, template status, and date of template creation:
{
"code": "200",
"message": "Request successfully executed!",
"data": [
{
"name": "BXXBXXD_Sale",
"status": {
"id": "1",
"name": "Approved"
},
"created_at": "1675182226"
},
{
"name": "Template2",
"status": {
"id": "1",
"name": "Rejected"
},
"created_at": "1674650304"
},
{
"name": "Template3",
"status": {
"id": "1",
"name": "Pending"
},
"created_at": "1674650154"
},
{
"name": "Template4",
"status": {
"id": "1",
"name": "Submission Rejected"
},
"created_at": "1665230132"
},
{
"name": "Template4",
"status": {
"id": "9",
"name": "Approved"
},
"created_at": "1660900841"
}
],
"error": [],
"total": 4,
"limit": 25,
"offset": 0
}
Error Codes
For information related to the WhatsApp error code, see WhatsApp Error Codes.
Updated 22 days ago