API URL Endpoint:
https://api.geniq.io/rest/v1/whatsapp/messages
General Parameter
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
recipient | integer | Yes | Recipient’s mobile number including country code without “+” prefix | |
reference | string | Optional | A unique reference ID for keeping track of requests and responses | |
type | boolean | Yes | Message type: – text – image – video – audio – document – location – template – sticker Please refer to the following tables for more info. |
- Send Text Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
body | string | Yes | Message to be sent out | |
previewUrl | boolean | Yes | To generate link previews if any URL exists in the message | false |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"text",
"body":"This is a test message. https://www.youtube.com/watch?v=EngW7tLk6R8",
"previewUrl":true,
"reference": "12345"
}' \
- Send Image/Video/Audio/Sticker Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | URL that your image or video file is uploaded to and should be publicly accessible to the file. Supported image type: -image/jpeg – image/png Supported video type: – video/mp4 – video/3gp Supported audio type: – audio/aac – audio/mp4 – audio/mpeg – audio/amr – audio/ogg Supported sticker type: – image/webp | |
caption | string | Optional | Image/video/audio/sticker caption |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"image",
"url":"https://images.pexels.com/photos/11742011/pexels-photo-11742011.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1",
"caption":"Sample Image",
"reference": "12345"
}' \
- Send Document Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | URL that your document file is uploaded to and should be publicly accessible to the file. Supported document type: – text/plain – application/pdf – application/vnd.ms-powerpoint – application/msword – application/vnd.ms-excel – application/vnd.openxmlformats-officedocument.wordprocessingml.document – application/vnd.openxmlformats-officedocument.presentationml.presentation – application/vnd.openxmlformats-officedocument.spreadsheetml.sheet | |
caption | string | Optional | Document caption | |
filename | string | Optional | Filename |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"document",
"url":"https://filesamples.com/samples/document/pdf/sample2.pdf",
"caption":"Test Doc",
"filename":"sample2.pdf",
"reference": "12345",
}' \
- Send Location Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
latitude | double | Yes | Latitude | |
longitude | double | Yes | Longitude | |
locationName | String | Optional | Location Name | |
address | String | Optional | Address |
Sample request using CURL:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"location",
"latitude": 55.7047,
"longitude": 13.191,
"locationName": "Test Location",
"address": "Scheelevägen 17",
"reference": "12345",
}' \
- Send Template Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
templateName | string | Yes | Template name | |
language | string | Yes | Template language | |
headerParams | array | Optional | Parameter(s) that will be used to replace the dynamic field in the message header | |
bodyParams | array | Optional | Parameter(s) that will be used to replace the dynamic field in the message body |
Sample request using CURL:
Sample 1:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"location",
"templateName":"template1",
"language": "en",
"reference": "12345",
}' \
Sample 2:
$ curl -X POST https://api.geniq.io/rest/v1/whatsapp/messages \
-H 'Authorization: Basic dXNlcjE6cGFzczE=' \
-H 'Content-Type: application/json' \
-d '{
"recipient":"6591234567",
"type":"location",
"templateName":"template1",
"headerParams": [
"Header Param 1"
],
"bodyParams": [
"Body Param 1",
"Body Param 2"
],
"language": "en",
"reference": "12345",
}' \
Parameters returned in the API response:
PARAMETER | FORMAT | DESCRIPTION |
reference | string | If reference parameter is submitted during the API request, the same value will be returned |
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 |
messageId | string | A unique ID for the sent SMS |
Sample Response:
{
"reference":"12345",
"responseMessage":"Success",
"responseCode":"0",
"messageId":"76CEEFFFD89C9193391D631A9EE74E27"
}