Send message API

Request

  • Base URL
    https://api.gupshup.io/wa/api/v1
  • URL
    https://api.gupshup.io/wa/api/v1/msg
  • Auth
    none declared. Required headers: Content-Type, apikey

Headers

Content-Type'application/x-www-form-urlencoded' required
Example:application/x-www-form-urlencoded
apikeystring required
Example:092707e8296649XXXX94c0fXXX818ad

Request body application/x-www-form-urlencoded

channelstring required

The channel for sending messages.

sourceinteger required

Registered WhatsApp Business API phone number

destinationinteger required

User's phone number

src.namestring required

The Gupshup app name registered against the phone number provided in the API.

disablePreviewboolean

This is only applicable for text messages. By default, the mobile WhatsApp application recognizes URLs and makes them clickable. To include a URL preview, include "preview_url": true in the message body and make sure the URL begins with http:// or https://. A hostname is required, IP addresses are not matched.

encodeboolean

This flag is used for sending an emoji in an Interactive List message. If the list message consists of emojis, set the encode flag to 'true'. This flag will not affect any other type of message.

Example request

{
  "channel": "whatsapp",
  "source": 917472850482,
  "destination": 918748133759,
  "message": {
    "type": "text",
    "text": "Hello user, how are you?"
  },
  "src.name": "myapp"
}

Response

Send message API requests received by our platform are processed asynchronously, and hence you will always get an HTTP_SUCCESS(200 to 299) response range if the API request made is correct.

statusstring

The API call was successfully made and the request is submitted.

messageIdstring

It is the unique identifier for a message. You can track message status via the DLR message events obtained on the webhook.

Example response

{
  "status": "submitted",
  "messageId": "ee4a68a0-1203-4c85-8dc3-49d0b3226a35"
}

Changes

    • breaking

      added the new required header request parameter Content-Type

    • breaking

      added the new required header request parameter apikey

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      the request property became required

    • breaking

      removed the enum value whatsapp of the request property

    • breaking

      the request property type changed from string to integer, and format from no format to int64

    • breaking

      the request property type changed from string to object

    • breaking

      the request property type changed from string to integer, and format from no format to int64

    • breaking

      removed the success response with the status

    • info

      api tag Send message API added

    • info

      added the new optional request property

    • info

      added the new optional request property

    • info

      request body became optional

    • info

      added to the request property oneOf list