Skip to content

List WhatsApp Templates

Type: mosend-list-templates  ·  Package: Mosend WhatsApp Activities v1.0.4  ·  Output: List<object>

Lists the WhatsApp templates of the Mosend account: name, language, approval status, category and body text. Use it to know which template to send with Send WhatsApp Template without opening Mosend, or to check that a template is still approved before a bulk send.

Gets the Mosend session of the integration and queries the organization’s templates (up to 200). By default it returns only the ones approved by Meta (APPROVED); with onlyApproved = false it also returns pending (PENDING) and rejected (REJECTED) ones.

The body field contains the template’s body text, with its {{1}}, {{2}}… placeholders, so you know how many variables to send.

ParameterTypeDefaultDescription
integrationstring—Name of the Mosend account in the environment’s Centro › Recursos › Integraciones (Center › Resources › Integrations), Mensajería section. E.g.: mosend.
ParameterTypeDefaultDescription
onlyApprovedbooltrueReturn only the templates approved by Meta. Defaults to true.

Returns a List<object>, one entry per template:

FieldDescription
idTemplate id in Mosend.
nameTemplate name: the one you put in template of Send WhatsApp Template.
languageLanguage code (e.g. es, en_US).
statusStatus in Meta, uppercase: APPROVED, PENDING, REJECTED.
categoryTemplate category in Meta.
bodyBody text, with its {{n}} variables.

The activity fails with these messages, without a prefix; catch them with Try / Catch:

MessageCause and fix
'…' is required.A required parameter is missing (the message names it).
The Mosend integration '…' does not exist in this environment. Create it in Center › Resources › Integrations.The integration name doesn’t match any Mosend integration in the environment where the robot runs. Check it under Integrations in Zoan Cloud.
Mosend activities need the Zoan Cloud runtime context (…).The process isn’t running from Zoan Cloud or from the Designer signed in.
Zoan Cloud refused the Mosend session for '…': HTTP …: …Zoan Cloud couldn’t hand out the integration’s session (for example, the OAuth authorization expired or was revoked). Reconnect the integration.
Mosend rejected the session (401). Reconnect the integration in Center › Resources › Integrations.The API key or token is no longer valid. Reconnect the integration.
Mosend denied the operation (403): the account lacks the permission. …The Mosend account doesn’t have permission for that operation.
Mosend rate limit reached (429). Retry later.Too many requests in a row. Retry with Retry and a wait.
Mosend responded HTTP …: …Another Mosend error; the detail (up to 300 characters of the response) follows the colon.

Log the account’s approved templates with their text:

List WhatsApp Templates integration = "mosend" → output: templates
For Each items = templates itemVariable = t
└─ activities:
Log level = info message = str(t["name"]) + " (" + str(t["language"]) + "): " + str(t["body"])