Yes, you can send a PDF file using the createWhatsAppMessage API endpoint. To do this, you must use a pre-approved WhatsApp message template from Meta that is configured with a document header.
In your API request, you will pass the public URL of your PDF file within the header_variables object, under the "document" key.
Example Request:
{
"request": {
"application": "APP_CODE",
"auth": "API_TOKEN",
"notifications": [
{
"send_date": "now",
"content_id": "your_meta_template_name",
"header_variables": {
"document": "https://example.com/file.pdf"
},
"devices": [
"whatsapp:+1234567890"
]
}
]
}
}
Key Points to Remember:
- Your
content_idmust be the name of a Meta-approved template that includes a document header. - The PDF file must be hosted at a publicly accessible URL.
- Each API request should only contain one WhatsApp number in the
devicesarray. - Ensure that your WhatsApp configuration is fully set up in your Pushwoosh account before sending messages.
Comments
0 comments
Please sign in to leave a comment.