Send WhatsApp Text
Send WhatsApp Text
Section titled “Send WhatsApp Text”Type: mosend-send-text · Package: Mosend WhatsApp Activities v1.0.4 · Output: object
Sends a WhatsApp text message from one of the numbers of your Mosend account. It is the way to reply to a customer who has just written: confirm a request, give a status update, ask for a piece of information. Returns the id and status of the sent message.
How it works
Section titled “How it works”- Gets the Mosend session of the integration set in
integration(see how the robot connects). - Identifies the sender number
from: it accepts the number as shown in Mosend or its id. - Cleans the recipient number
to(only the digits are kept) and sends the text.
The text supports WhatsApp formatting (*bold*, _italic_). If it exceeds 4096 characters (WhatsApp’s limit), it is cut to that length before sending and a warning in the log states how many characters it had and how many were sent. To send a long text in full, split it into several messages.
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. |
from | string | — | WhatsApp number of the sending account, as shown in Mosend (e.g. +57 300 000 0000), or its Mosend id. |
to | string | — | Recipient phone in international format, with or without +. E.g.: +57 300 000 0001. |
text | string | — | Message text. Supports *bold* and _italic_. Max 4096 characters; a longer text is truncated, with a warning in the log. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
replyToMessageId | string | — | Id of a previous message to quote in the reply. |
Output
Section titled “Output”Returns an object with:
| Field | Description |
|---|---|
id | Message id in Mosend. |
status | Status reported by Mosend (defaults to sent). |
to | Recipient number, digits only (e.g. 573000000001). |
conversationId | Conversation id in Mosend. |
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. |
'to' must be a phone number in international format (e.g. +57 300 123 4567). | to has fewer than 8 digits. |
The 'from' WhatsApp number was not found in the Mosend organization. … | from doesn’t match any number in the account. Use the number as shown in Mosend or its id. |
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”Send WhatsApp Text integration = "mosend" from = "+57 300 000 0000" to = "+57 300 000 0001" text = "Hi, Test Customer. We received your request *#0001* and are reviewing it." → output: messageLog level = info message = "Message sent: " + str(message["id"])Related activities
Section titled “Related activities”- Send WhatsApp Template — to write outside the 24-hour window.
- Send WhatsApp File — send an image or a document.
- Find WhatsApp Contact — look up a contact before writing to them.