API URL Endpoint: https://api.geniq.io/rest/v1/whatsapp/messages
The WhatsApp API supports the following message types:
- text
- image
- video
- audio
- document
- location
- template
- sticker
When sending a request, you must specify the type of message being sent. Additionally, some parameters are commonly used in the WhatsApp API, regardless of the message types. Please refer to the following table for details:
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
recipient | integer | Yes | Recipient’s mobile number including country code without “+” prefix | |
type | boolean | Yes | Message type | |
reference | string | Optional | A unique reference ID for keeping track of requests and responses |
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Bearer [TOKEN]' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"[message_type]",
...
"reference": "12345",
}' \
The response from our WhatsApp API will follow a standard format, regardless of the message type being sent. This ensures consistency and simplicity when handling API responses.
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
reference | string | If a reference parameter is submitted during the API request, the same value will be returned |
messageIds | array | A list of unique IDs for each SMS sent. If the SMS message length is too long, the API will automatically split it into multiple SMS parts and return the list of messageIds |
responseMessage | string | Response message returned from the API call |
responseCode | integer | Response code returned from the API call. Refer to section “Response Codes” for list of possible values |
Sample Response:
{
"reference":"12345",
"messageIds":["63a2bf90-dd60-4b0e-9c0a-a05cac613a12"],
"responseMessage":"Success",
"responseCode":"0"
}