logo
enes

Get and delete templates

Last update: 6 hours ago by Irais Aguirre

Get templates, get a template by ID, and delete a template.

Integration summary

  • Base URL: https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services
  • Token: admin token, in the Authorization: Bearer {{admin-token}} header (how to generate it)
  • Endpoints on this page:
    • GET /v1/template/{{waba_id}}: Get templates
    • GET /v1/template/{{waba_id}}/{{template_id}}: Get template by ID
    • DELETE /v1/template/{{waba_id}}?template_name={{template_name}}: Delete template

Get templates

Request

Get templates request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}
MethodGET
Typeapplication/json

Headers

Get templates headers:

NameDescriptionTypeRequirements
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Get templates parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account (WABA) ID. It must be the WABA linked to your token. Digits only.StringRequired

Example

Complete Get templates example:

curl "https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}" \
-H 'Authorization: Bearer {{admin-token}}'

Response

Get templates response:

NameDescriptionType
idTemplate ID.String
nameTemplate name.String
languageTemplate locale. Example: es_ES, es_MX, es_US. Supported languages: https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/String
namespaceThe namespace to use. If the namespace doesn't match element_name, the message isn't sent.String
statusCurrent status of the template. For example:
  • APPROVED
  • REJECTED
  • PENDING
String
categoryTemplate category:
  • AUTHENTICATION
  • MARKETING
  • UTILITY
String
rejectedReasonRejection reason. Only included if the template was rejected.String
createdCreation date.String
allowCategoryChangeWhether Meta can automatically assign the template category.Boolean

[
{
"id": "747393629111800",
"name": "aviso",
"language": "es_MX",
"status": "APPROVED",
"namespace": "2d5051d2_76fd_43e4_842f_2d5b215188fa",
"category": "UTILITY",
"created": "2021-11-23T16:18:49.285",
"allowCategoryChange": true
},
{
"id": "142990321034346",
"name": "bienvenida",
"language": "es",
"status": "APPROVED",
"namespace": "2d5051d2_76fd_43e4_842f_2d5b215188fa",
"category": "MARKETING",
"created": "2021-11-23T16:18:49.285",
"allowCategoryChange": true
}
]


Get template by ID

Request

Get template by ID request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}/{{template_id}}
MethodGET
Typeapplication/json

Headers

Get template by ID headers:

NameDescriptionTypeRequirements
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Get template by ID parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account (WABA) ID. It must be the WABA linked to your token.StringRequired
template_idTemplate ID.StringRequired

Example

Complete Get template by ID example:

curl "https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}/{{template_id}}" \
-H 'Authorization: Bearer {{admin-token}}'

Response

Get template by ID response:

Note: if the template or its WABA information isn't found, the service responds with HTTP 204 and an empty body.

NameDescriptionType
idTemplate ID.String
nameTemplate name.String
languageTemplate language and locale code.String
statusTemplate status.String
categoryTemplate category.String
structureTemplate structure: header, body, footer, and buttons.Structure object
allowCategoryChangeWhether Meta can automatically assign the template category.Boolean

{
"id": "642673911170541",
"name": "ejemplo_template",
"language": "es",
"status": "APPROVED",
"category": "MARKETING",
"structure":
{
"body":
{
"text": "Happy holidays, {{1}}! Wishing you joy and happiness with your loved ones.",
"example":
{
"body_text":
[
[
"Customer"
]
]
}
}
},
"allowCategoryChange": true
}


Delete template

Request

Delete template request:

URLhttps://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}?template_name={{template_name}}
MethodDELETE
Typeapplication/json

Headers

Delete template headers:

NameDescriptionTypeRequirements
Content-Typeapplication/jsonStringRequired
AuthorizationAdmin token. See Generate authentication token.StringRequired

Parameters

Delete template parameters:

NameDescriptionTypeRequirements
waba_idWhatsApp Business Account (WABA) ID. It must be the WABA linked to your token. Digits only.StringRequired
template_nameTemplate name, sent as a query parameter. All languages of the template with this name are deleted.StringRequired

Example

Complete Delete template example:

curl -X DELETE "https://{{url}}/whatsapp-bsp-admin-ext-endpoint-ws/services/v1/template/{{waba_id}}?template_name={{template_name}}" \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer {{admin-token}}'

Response

Delete template response:

NameDescriptionType
codeStatus code. 0 means the template was deleted; 10 means it couldn't be deleted.Integer
detailStatus detail of the response.String

{
"code": 0,
"detail": "Success"
}


Get template status

To get the status and quality of your WABA's templates (the template-status endpoint), see Get template quality in the Quality monitoring section.

Previous
Create template
Next
Upload media