capabilities.work

Upload and Send Document

A 2-step recipe with WhatsApp. We can help you get access.

Recipe · 2 steps

Upload and Send Document

Upload a document and deliver it to a WhatsApp user as a document message.

  1. Upload the binary document file to the WhatsApp media endpoint to obtain a reusable media ID.
  2. Send a document message to the recipient referencing the uploaded media ID with the supplied display filename.
What you'll need to have ready
  • accessToken: Access token with whatsapp_business_messaging permission.
  • phoneNumberId: The WhatsApp phone number ID that sends the message.
  • to: Recipient phone number in E.164 format without the leading plus.
  • file: The binary document file content to upload.
  • fileType: MIME type of the document (e.g. application/pdf).
  • filename: Filename to display to the recipient.
  • caption: Optional caption text to display with the document.
For your developer

Arazzo workflow whatsapp:upload-media-send-document, 2 operations: uploadMedia → postByPhoneNumberIdMessages. Specs on APIs.io.