Ventia
Whatsapp business

Send message

Sends a message to a contact through an official WhatsApp (WhatsApp Business) channel. The message is registered as an interaction on the contact, the same as messages sent from Ventia. Supported types: `text`, `image`, `video`, `audio`, `document` (by public URL), `location` and `template`. Outside the 24-hour customer service window only `template` messages are delivered by WhatsApp. Requires the `interactions:create` scope.

POST
/whatsapp-business/{channelId}/{contactId}/messages

Authorization

bearerAuth
headerAuthorizationBearer <token>

API key sent as Authorization: Bearer <API_KEY>.

Path Parameters

channelId*string

Id of the official WhatsApp channel (WhatsApp Business) in Ventia.

contactId*string

Id of the recipient contact in Ventia. The message is sent to the contact's first phone number.

Request Body

application/json
  1. body
message*

Response Body

Message sent.

application/json
curl -X POST 'https://api.getventia.com/api/v1.0/whatsapp-business/string/string/messages' \  -H 'Content-Type: application/json' \  -d '{  "message": {    "type": "template",    "template": {      "name": "order_ready",      "language": {        "code": "es"      },      "components": [        {          "type": "body",          "parameters": [            {              "type": "text",              "text": "Ana"            },            {              "type": "text",              "text": "#1234"            }          ]        }      ]    }  }}'
{  "success": true,  "interactionId": "665f1c2e8b3e4a00aaaaaaaa",  "wppId": "wamid.HBgLNTk4OTk...",  "status": "sent"}