Send WhatsApp File
Send WhatsApp File
Section titled “Send WhatsApp File”Type: mosend-send-file · Package: Mosend WhatsApp Activities v1.0.4 · Output: object
Sends a file from the robot’s disk (a PDF invoice, a photo, a receipt, an audio clip) over WhatsApp, with optional accompanying text. The robot uploads the file to Mosend and then sends it to the recipient.
How it works
Section titled “How it works”-
Checks that the
filePathfile exists and infers its type from the extension:Type Extensions WhatsApp limit Image .jpg,.jpeg,.png,.webp,.gif5 MB Video .mp4,.3gp16 MB Audio .mp3,.ogg,.aac16 MB Document .pdf,.doc(x),.xls(x),.ppt(x),.txt,.csvand any other extension100 MB -
If the file exceeds the limit for its type, it fails before uploading it.
-
Gets the Mosend session, identifies the
fromnumber and uploads the file to Mosend. -
Sends the message to
towith the file, the caption (caption) and, for documents, the name the recipient will see (fileName).
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. |
filePath | string | — | Full path of the file on this machine. The type (image, document, video, audio) is inferred from the extension. E.g.: C:\invoices\F-0001.pdf. |
Optional parameters
Section titled “Optional parameters”| Parameter | Type | Default | Description |
|---|---|---|---|
caption | string | — | Text shown with the file. |
fileName | string | file name | Name the recipient sees for documents. Defaults to the file’s name. |
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. |
conversationId | Conversation id in Mosend. |
mediaId | Id of the file uploaded to 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. |
Local file not found. | filePath doesn’t exist on the robot’s machine. |
'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. |
The file exceeds WhatsApp's limit for …s (… MB). | The file is larger than its type’s limit. Share it with a link (for example with Get Storage File URL). |
Mosend did not return a media id after the upload. | The upload to Mosend didn’t return the file. Retry. |
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 File integration = "mosend" from = "+57 300 000 0000" to = "+57 300 000 0001" filePath = "C:/invoices/F-0001.pdf" fileName = "Invoice F-0001.pdf" caption = "Hi, Test Customer. Your invoice is attached." → output: deliveryRelated activities
Section titled “Related activities”- Send WhatsApp Text — text only.
- Send WhatsApp Template — to start the conversation outside the 24-hour window.