Send Message
This endpoint is used to send a message to a chat
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Headers
Please provide the number of the phone you want to call with this API in the header. The number must be in country code + number format without any characters or spaces, e.g. 919876543210; Alternatively, provide the phone_id (phone-xxxxxxxxxxxx) in the header
Body
- For groups, enter the chat_id of the group. This will be a string that ends with @g.us
- For 1-1 chats, enter the country_code + number of the recipient e.g. 919537851844@c.us (The @c.us is optional)
- Required to send a media object. You can send a public URL of the media content, or the base64 data of the media
- Media can be a document, image, video or audio
url
- public URL that hosts the content to be sentfiledata
- Raw bytes of the file, represented in base64type
- The type of the media. Can be image, video, document or audiofilename
- The filename of the media. Only applicable for document messages
The text body or caption. You can use basic markdown formatting supported by WhatsApp e.g. * for bold, and _ for italic, etc.
To reply to a message, add the message_id in this field
Response
The response object contains the queue_id
and the position
in the queue
You can check the status of the sent message in the queue using the /queue/jobs
endpoint
The queue_id
can also be mapped in the message object against the sent_message_id
Was this page helpful?