As rotas de Modelos. Todo corpo é JSON, e o erro sempre volta como um objeto com código e mensagem.
GET
/v1/templates
List message templates
Local drafts and the mirror of the WABA's templates, with the status Meta gave each one.
Resposta (object[])
- idstringObrigatório
- Zaiped id (templates)
- namestringObrigatório
- languagestringObrigatório
- categorystringObrigatório
- statusstring
- metaTemplateIdstring
- componentsany[]Obrigatório
- parameterFormatstring
- ttlSecondsnumber
- variablesstring[]Obrigatório
- bodystringObrigatório
- rejectedReasonstring
- qualityScorestring
curl -X GET "https://zaiped.com/v1/templates" \
-H "Authorization: Bearer zp_..."
POST
/v1/templates
Create a template
Creates the template with Meta's `components` format and, by default, submits it for review right away. Header media is added in the console.
Corpo da requisição
- namestringObrigatório
- languagestringObrigatório
- category"UTILITY" | "MARKETING" | "AUTHENTICATION"Obrigatório
- componentsany[]Obrigatório
- ttlSecondsnumber
- submitboolean
Resposta (object)
- idstringObrigatório
- Zaiped id (templates)
- namestringObrigatório
- languagestringObrigatório
- categorystringObrigatório
- statusstring
- metaTemplateIdstring
- componentsany[]Obrigatório
- parameterFormatstring
- ttlSecondsnumber
- variablesstring[]Obrigatório
- bodystringObrigatório
- rejectedReasonstring
- qualityScorestring
curl -X POST "https://zaiped.com/v1/templates" \
-H "Authorization: Bearer zp_..." \
-H "Content-Type: application/json" \
-d '{
"name": "…",
"language": "…",
"category": "UTILITY",
"components": []
}'GET
/v1/templates/{templateId}
Get a template
Parâmetros de caminho
- templateIdstringObrigatório
- The template id, as returned by list_templates.
Resposta (object)
- idstringObrigatório
- Zaiped id (templates)
- namestringObrigatório
- languagestringObrigatório
- categorystringObrigatório
- statusstring
- metaTemplateIdstring
- componentsany[]Obrigatório
- parameterFormatstring
- ttlSecondsnumber
- variablesstring[]Obrigatório
- bodystringObrigatório
- rejectedReasonstring
- qualityScorestring
curl -X GET "https://zaiped.com/v1/templates/YOUR_TEMPLATE_ID" \
-H "Authorization: Bearer zp_..."
PUT
/v1/templates/{templateId}
Edit a submitted template
Meta accepts edits on APPROVED, REJECTED and PAUSED templates and reviews again.
Parâmetros de caminho
- templateIdstringObrigatório
- The template id.
Corpo da requisição
- category"UTILITY" | "MARKETING" | "AUTHENTICATION"Obrigatório
- componentsany[]Obrigatório
- ttlSecondsnumber
Resposta (object)
- oktrueObrigatório
curl -X PUT "https://zaiped.com/v1/templates/YOUR_TEMPLATE_ID" \
-H "Authorization: Bearer zp_..." \
-H "Content-Type: application/json" \
-d '{
"category": "UTILITY",
"components": []
}'DELETE
/v1/templates/{templateId}
Delete a template
Deletes it locally and, if submitted, in the WABA. Meta blocks the name for 30 days after deleting an approved template.
Parâmetros de caminho
- templateIdstringObrigatório
- The template id.
Resposta (object)
- oktrueObrigatório
curl -X DELETE "https://zaiped.com/v1/templates/YOUR_TEMPLATE_ID" \
-H "Authorization: Bearer zp_..."
POST
/v1/templates/{templateId}/unpause
Unpause a template paused for quality
Parâmetros de caminho
- templateIdstringObrigatório
- The template id.
Resposta (object)
- successbooleanObrigatório
- reasonstring
curl -X POST "https://zaiped.com/v1/templates/YOUR_TEMPLATE_ID/unpause" \
-H "Authorization: Bearer zp_..."
POST
/v1/templates/sync
Sync templates from the WABA
Re-reads every template from Meta, including ones created in WhatsApp Manager.
Resposta (object)
- oktrueObrigatório
curl -X POST "https://zaiped.com/v1/templates/sync" \
-H "Authorization: Bearer zp_..."