Messages
Send Text Message
POST
/api/v1/chat/send/textSend a text message. Add ContextInfo to reply to a message, LinkPreview for a link preview.
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.
- LinkPreviewbooleanOptional
Show a preview for the first link in the text. Default false.
- 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). MentionedJID lists people to mention.
- QuotedTextstringOptional
Text of the message you reply to, for the quote preview.
- QuotedMessageobjectOptional
Custom quote preview to show above your reply.
- MentionAllbooleanOptional
In a group, mention every member without showing their numbers.
| 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. |
| LinkPreview | boolean | No | Show a preview for the first link in the text. Default false. |
| 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). MentionedJID lists people to mention. |
| QuotedText | string | No | Text of the message you reply to, for the quote preview. |
| QuotedMessage | object | No | Custom quote preview to show above your reply. |
| MentionAll | boolean | No | In a group, mention every member without showing their numbers. |
Code Examples
cURL
curl -X POST "https://orvachat.com/api/v1/chat/send/text" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"Phone": "923001234567",
"Body": "Hello from the API"
}'Response Example
200 OK
{
"code": 200,
"data": {
"Details": "Sent",
"Id": "90B2F8B13FAC8A9CF6B06E99C7834DC5",
"Timestamp": "2022-04-20T12:49:08-03:00"
},
"success": true
}