whatsAppTemplates
Requires permission settings:integration:read.
Fetches the message templates from the WhatsApp provider account, live, so a trigger can be mapped to one. Requires permission to read integrations.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
query WhatsAppTemplates {
whatsAppTemplates {
detail
ok
templates {
languageCode
name
status
bodyText
category
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "query WhatsAppTemplates {\n whatsAppTemplates {\n detail\n ok\n templates {\n languageCode\n name\n status\n bodyText\n category\n }\n }\n}"
}
EOF
Response:
{
"data": {
"whatsAppTemplates": {
"detail": "string",
"ok": true,
"templates": [
{
"languageCode": "string",
"name": "string",
"status": "string",
"bodyText": "string",
"category": "string"
}
]
}
}
}
whatsAppTemplates(
provider: WhatsAppProvider
): WhatsAppTemplatesResultGql!
Arguments
whatsAppTemplates.provider ● WhatsAppProvider enum
The WhatsApp provider to use. Omit it to use the organization's enabled provider, else its most recently edited one.
Type
WhatsAppTemplatesResultGql object
The templates fetched from the provider. When ok is false, enter the template by hand.