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

Send WhatsApp Message

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:

PARAMETERFORMATREQUIREDDESCRIPTIONDEFAULT
recipientintegerYesRecipient’s mobile number including country code without “+” prefix
typebooleanYesMessage type
referencestringOptionalA 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:

PARAMETERFORMATDESCRIPTION
referencestringIf a 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 section “Response Codes” for list of possible values

Sample Response:

{
    "reference":"12345",
    "messageIds":["63a2bf90-dd60-4b0e-9c0a-a05cac613a12"],
    "responseMessage":"Success",
    "responseCode":"0"
}

Articles