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 | |
type | boolean | Yes | Message type: – text – image – video – audio – document – location – template – sticker Please refer to the following tables for more info. | |
reference | string | Optional | A unique reference ID for keeping track of requests and responses |
- Send Text Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
body | string | Yes | Message to be sent out | |
previewUrl | boolean | Optional | 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 Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | The URL that your image file is uploaded to should be publicly accessible. Supported image type: - image/jpeg (.jpg, .jpeg)– image/png (.png) Max size: – 5 MB | |
caption | string | Optional | 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/25002430/pexels-photo-25002430/free-photo-of-shot-with-oldroll-classic-m.jpeg",
"caption":"Sample Image",
"reference": "12345"
}' \
- Send Video Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | The URL that your video file is uploaded to should be publicly accessible. Supported video type: – video/mp4 (.mp4) – video/3gp (.3gp) Max size: – 15 MB | |
caption | string | Optional | 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":"video",
"url":"https://videos.pexels.com/video-files/3209828/3209828-uhd_3840_2160_25fps.mp4",
"caption":"Sample Video",
"reference": "12345"
}' \
- Send Audio Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | The URL that your audio file is uploaded to should be publicly accessible. Supported audio type: – audio/aac (.aac) – audio/mp3 (.mp3) – audio/mp4 (.m4a) – audio/amr (.amr) – audio/ogg (.ogg) Max size: – 15 MB |
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":"audio",
"url":"https://download.samplelib.com/mp3/sample-3s.mp3",
"reference": "12345"
}' \
- Send Sticker Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | The URL that your sticker file is uploaded to should be publicly accessible. Supported sticker type: – image/webp (.webp) Max size: – 100 KB | |
caption | string | Optional | 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":"sticker",
"url":"https://file-examples.com/storage/fe15076da466528199d9c5a/2020/03/file_example_WEBP_50kB.webp",
"caption":"Sample Sticker",
"reference": "12345"
}' \
- Send Document Message
PARAMETER | FORMAT | REQUIRED | DESCRIPTION | DEFAULT |
url | string | Yes | The URL that your document file is uploaded to should be publicly accessible. Supported document type: – text/plain (.txt) – application/pdf (.pdf) – application/vnd.ms-excel (.xls) – application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (.xlsx) – application/msword (.doc) – application/vnd.openxmlformats-officedocument.wordprocessingml.document (.docx) – application/vnd.ms-powerpoint (.ppt) – application/vnd.openxmlformats-officedocument.presentationml.presentation (.pptx) Max size: – 100 MB | |
caption | string | Optional | 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 |
name | 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",
"name":"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",
"name":"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 |
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 the section “Response Codes” for a list of possible values |
Sample Response:
{
"reference":"12345",
"messageIds":["63a2bf90-dd60-4b0e-9c0a-a05cac613a12"],
"responseMessage":"Success",
"responseCode":"0"
}