1. Home
  2. Docs
  3. WhatsApp
  4. Send WhatsApp Message

Send WhatsApp Message

API URL Endpoint: https://api.geniq.io/rest/v1/whatsapp/messages

General Parameter

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
recipientintegerYesRecipient’s mobile number including country code without “+” prefix
typebooleanYesMessage type:
– text
– image
– video
– audio
– document
– location
– template
– sticker


Please refer to the following tables for more info.
referencestringOptionalA unique reference ID for keeping track of requests and responses

  • Send Text Message
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
bodystringYesMessage to be sent out
previewUrlbooleanOptionalTo generate link previews if any URL exists in the messagefalse

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
urlstringYesThe 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
captionstringOptionalCaption

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
urlstringYesThe 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
captionstringOptionalCaption

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
urlstringYesThe 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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
urlstringYesThe URL that your sticker file is uploaded to should be publicly accessible.

Supported sticker type:
– image/webp (.webp)

Max size:
– 100 KB
captionstringOptionalCaption

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
urlstringYesThe 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
captionstringOptionalCaption
filenamestringOptionalFilename

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
latitudedoubleYesLatitude
longitudedoubleYesLongitude
locationNameStringOptionalLocation Name
addressStringOptionalAddress

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
PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
namestringYesTemplate name
languagestringYesTemplate language
headerParamsarrayOptionalParameter(s) that will be used to replace the dynamic field in the message header
bodyParamsarrayOptionalParameter(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:

PARAMETERFORMATDESCRIPTION
referencestringIf reference parameter is submitted during the API request, the same value will be returned
messageIdsarrayA 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
responseMessagestringResponse message returned from the API call
responseCodeintegerResponse 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"
}