Messages
Send Buttons Message
POST
/api/v1/chat/send/buttonsSend a message with up to 3 buttons (reply, cta_url, cta_call or copy).
Parameters
- PhonestringRequired
Who gets it: phone number with country code (e.g. 923001234567), or a chat id like …@g.us for a group.
- BodystringRequired
The message text.
- ButtonsarrayRequired
Up to 3 buttons. Each has type, title and id. Type reply needs nothing more; cta_url also needs url, cta_call needs phone_number, copy needs copy_code.
- TitlestringOptional
A title above the text.
- FooterstringOptional
Small text under the message.
- ImagestringOptional
An image on top, as a base64 data URL.
- IdstringOptional
Your own id for the message. Leave it out and one is made for you.
- ContextInfoobjectOptional
Reply to a message: StanzaId (the message id) and Participant (who sent it).
| Name | Type | Required | Description |
|---|---|---|---|
| Phone | string | Yes | Who gets it: phone number with country code (e.g. 923001234567), or a chat id like …@g.us for a group. |
| Body | string | Yes | The message text. |
| Buttons | array | Yes | Up to 3 buttons. Each has type, title and id. Type reply needs nothing more; cta_url also needs url, cta_call needs phone_number, copy needs copy_code. |
| Title | string | No | A title above the text. |
| Footer | string | No | Small text under the message. |
| Image | string | No | An image on top, as a base64 data URL. |
| Id | string | No | Your own id for the message. Leave it out and one is made for you. |
| ContextInfo | object | No | Reply to a message: StanzaId (the message id) and Participant (who sent it). |
Code Examples
cURL
curl -X POST "https://orvachat.com/api/v1/chat/send/buttons" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Phone": "923001234567",
"Body": "Do you want to order?",
"Footer": "Reply with a button",
"Buttons": [
{
"type": "reply",
"title": "Yes",
"id": "yes"
},
{
"type": "reply",
"title": "No",
"id": "no"
}
]
}'Response Example
200 OK
{
"code": 200,
"data": {
"Details": "Sent",
"Id": "90B2F8B13FAC8A9CF6B06E99C7834DC5",
"Timestamp": "2022-04-20T12:49:08-03:00"
},
"success": true
}