List WhatsApp Templates
List WhatsApp Templates
Section titled “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.
How it works
Section titled “How it works”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.
Required parameters
Section titled “Required parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
integration | string | — | Name of the Mosend account in the environment’s Centro › Recursos › Integraciones (Center › Resources › Integrations), Mensajería section. E.g.: mosend. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
onlyApproved | bool | true | Return only the templates approved by Meta. Defaults to true. |
Output
Section titled “Output”Returns a List<object>, one entry per template:
| Field | Description |
|---|---|
id | Template id in Mosend. |
name | Template name: the one you put in template of Send WhatsApp Template. |
language | Language code (e.g. es, en_US). |
status | Status in Meta, uppercase: APPROVED, PENDING, REJECTED. |
category | Template category in Meta. |
body | Body text, with its {{n}} variables. |
Common errors
Section titled “Common errors”The activity fails with these messages, without a prefix; catch them with Try / Catch:
| Message | Cause 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. |
Example
Section titled “Example”Log the account’s approved templates with their text:
List WhatsApp Templates integration = "mosend" → output: templatesFor Each items = templates itemVariable = t └─ activities: Log level = info message = str(t["name"]) + " (" + str(t["language"]) + "): " + str(t["body"])Related activities
Section titled “Related activities”- Send WhatsApp Template — send one of these templates.
- Find WhatsApp Contact — look up the recipient.