Templates
GET /:account/whats_app/templates
Lists the WhatsApp message templates available to an Account. Results can be filtered by title, user, status, or quality and ordered by title, created_at, or updated_at.
Examples
List all WhatsApp templates
Request
GET /my_account/whats_app/templates
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /my_account/whats_app/templates
Response
Status
200
Response Type
Example Body
{
"@type": "hydra:Collection",
"id": "/my_account/whats_app/templates",
"@context": "/contexts/hydra:Collection.jsonld",
"totalItems": 1,
"members": [
{
"@type": "WhatsApp::Template",
"@context": "/contexts/WhatsApp::Template.jsonld",
"id": "dkDdrbR",
"title": "appointment_reminder",
"language": "en_US",
"status": "approved",
"quality": "high",
"contentSid": "HXabcdef1234567890abcdef1234567890",
"contentType": "quick_reply",
"content": {
"body": "Hi , please confirm your appointment on at :",
"quickReplies": [
{
"id": "confirm",
"title": "Confirm"
},
{
"id": "cancel",
"title": "Cancel"
}
]
},
"category": null,
"createdAt": "2024-01-01T00:00:00.000Z",
"updatedAt": "2024-01-01T00:00:00.000Z",
"variables": [
{
"example": "12/1",
"name": "appt_date",
"type": "text"
},
{
"example": "12:00pm",
"name": "appt_time",
"type": "text"
},
{
"name": "contact.name",
"personalization_variable": "",
"type": "personalization_variable"
}
]
}
]
}
Filtering by status
Templates can be filtered by approval status (e.g. approved, pending, rejected).
Request
GET /my_account/whats_app/templates?status[]=approved
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /my_account/whats_app/templates?status[]=approved
Response
Status
200
Response Type
Example Body
{
"@type": "hydra:Collection",
"id": "/my_account/whats_app/templates?status%5B%5D=approved",
"@context": "/contexts/hydra:Collection.jsonld",
"totalItems": 1,
"members": [
{
"@type": "WhatsApp::Template",
"@context": "/contexts/WhatsApp::Template.jsonld",
"id": "dkDdrbR",
"title": "appointment_reminder",
"language": "en_US",
"status": "approved",
"quality": "high",
"contentSid": "HXabcdef1234567890abcdef1234567890",
"contentType": "quick_reply",
"content": {
"body": "Hi , please confirm your appointment on at :",
"quickReplies": [
{
"id": "confirm",
"title": "Confirm"
},
{
"id": "cancel",
"title": "Cancel"
}
]
},
"category": null,
"createdAt": "2024-01-01T00:00:00.000000Z",
"updatedAt": "2024-01-01T00:00:00.000000Z",
"variables": [
{
"example": "12/1",
"name": "appt_date",
"type": "text"
},
{
"example": "12:00pm",
"name": "appt_time",
"type": "text"
},
{
"name": "contact.name",
"personalization_variable": "",
"type": "personalization_variable"
}
]
}
]
}
Filtering by quality
Templates can be filtered by quality rating (e.g. high, medium, low).
Request
GET /my_account/whats_app/templates?quality=high
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /my_account/whats_app/templates?quality=high
Response
Status
200
Response Type
Example Body
{
"@type": "hydra:Collection",
"id": "/my_account/whats_app/templates?quality=high",
"@context": "/contexts/hydra:Collection.jsonld",
"totalItems": 1,
"members": [
{
"@type": "WhatsApp::Template",
"@context": "/contexts/WhatsApp::Template.jsonld",
"id": "dkDdrbR",
"title": "appointment_reminder",
"language": "en_US",
"status": "approved",
"quality": "high",
"contentSid": "HXabcdef1234567890abcdef1234567890",
"contentType": "quick_reply",
"content": {
"body": "Hi , please confirm your appointment on at :",
"quickReplies": [
{
"id": "confirm",
"title": "Confirm"
},
{
"id": "cancel",
"title": "Cancel"
}
]
},
"category": null,
"createdAt": "2024-01-01T00:00:00.000000Z",
"updatedAt": "2024-01-01T00:00:00.000000Z",
"variables": [
{
"example": "12/1",
"name": "appt_date",
"type": "text"
},
{
"example": "12:00pm",
"name": "appt_time",
"type": "text"
},
{
"name": "contact.name",
"personalization_variable": "",
"type": "personalization_variable"
}
]
}
]
}
Filtering by user
Templates can be filtered to those owned by a specific user.
Request
GET /my_account/whats_app/templates?user_id=123
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /my_account/whats_app/templates?user_id=123
Response
Status
200
Response Type
No body
Ordering by title
Results can be sorted by title in ascending or descending order.
Request
GET /my_account/whats_app/templates?order[title]=asc
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
-H Authorization:"Bearer {token}" \
-X GET /my_account/whats_app/templates?order[title]=asc
Response
Status
200
Response Type
Example Body
{
"@type": "hydra:Collection",
"id": "/my_account/whats_app/templates?order%5Btitle%5D=asc",
"@context": "/contexts/hydra:Collection.jsonld",
"totalItems": 1,
"members": [
{
"@type": "WhatsApp::Template",
"@context": "/contexts/WhatsApp::Template.jsonld",
"id": "dkDdrbR",
"title": "appointment_reminder",
"language": "en_US",
"status": "approved",
"quality": "high",
"contentSid": "HXabcdef1234567890abcdef1234567890",
"contentType": "quick_reply",
"content": {
"body": "Hi , please confirm your appointment on at :",
"quickReplies": [
{
"id": "confirm",
"title": "Confirm"
},
{
"id": "cancel",
"title": "Cancel"
}
]
},
"category": null,
"createdAt": "2024-01-01T00:00:00.000000Z",
"updatedAt": "2024-01-01T00:00:00.000000Z",
"variables": [
{
"example": "12/1",
"name": "appt_date",
"type": "text"
},
{
"example": "12:00pm",
"name": "appt_time",
"type": "text"
},
{
"name": "contact.name",
"personalization_variable": "",
"type": "personalization_variable"
}
]
}
]
}