WhatsApp Business API

The WhatsApp Business API facilitates seamless integration of WhatsApp messaging into your applications, enabling efficient and personalized customer communication. With rich features, it empowers businesses to engage effectively, provide timely updates, and offer responsive customer support on a trusted platform, strengthening connections with their audience.

Endpoint

Headers

  • Name
    contentType
    Type
    string
    Description

    This should be set to application/json.

  • Name
    apiKey
    Type
    string
    Description

    Find your API key under your login account.

POST

Template with header - None

This endpoint is for templates having no fancy headers or complicated settings. It's easy to use—just plug it in, and you're good to go!

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

Optional attributes

  • Name
    campaignName
    Type
    string
    Description

    The WhatsApp campaign name refers to the specific name or title given to a campaign conducted through WhatsApp

Request

POST
   curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
        "from": "91XXXXXXXXXX", 
        "campaignName": "api-test", 
        "to": "91XXXXXXXXXX", 
        "templateName": "template_name", 
        "type": "template"
      }'

Response

{
    "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
    "data": [
    {
        "recipient": "91XXXXXXXXXX",
        "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
    }],
    "totalCount": 1,
    "message": "Message Sent Successfully!", 
    "error": null
    }

POST

Template with header - None and having variables

This endpoint is designed for templates without complex headers but supports parameters for customization. Simply plug in and configure your parameters for easy and efficient use.

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

  • Name
    components
    Type
    object
    Description

    To build a message content object for WhatsApp, typically include various fields such as param, header type(text, images, video, and other media).

  • Name
    body
    Type
    object
    Description

    Template body

  • Name
    params
    Type
    string
    Description

    If you have a registered template with placeholders and you need to submit parameter values in the same order as in the template, you can represent this as an array of values. Ensure that the values are not null, and if the template was registered without placeholders, you can submit an empty array.

Request

POST
   curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
      "from": "91XXXXXXXXXX ", 
      "campaignName": "api-test", 
      "to": "91XXXXXXXXXX",
      "templateName": "template_name",
      "components": {
        "body":{
         "params":["var1", "var2", "var3"]
        } 
       },
      "type": "template" 
    }'

Response


{
  "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
  "data": [
  {
  "recipient": "91XXXXXXXXXX",
  "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
  } ],
  "totalCount": 1,
  "message": "Message Sent Successfully!", "error": null
}

POST

Template with header - Text and having variables

This endpoint is for text-header templates with customizable parameters—simple integration, versatile customization.

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

  • Name
    components
    Type
    string
    Description

    To build a message content object for WhatsApp, typically include various fields such as param, header type(text, images, video, and other media).

  • Name
    body
    Type
    string
    Description

    Template body

  • Name
    params
    Type
    string
    Description

    If you have a registered template with placeholders and you need to submit parameter values in the same order as in the template, you can represent this as an array of values. Ensure that the values are not null, and if the template was registered without placeholders, you can submit an empty array.

  • Name
    Type(header type text)
    Type
    string
    Description

    To comply with the requirements, ensure that the URL provided for the image starts with either "https://" or "http://", and that the image is in one of the supported formats (JPG, JPEG, or PNG) with a maximum size of 5MB.

Optional attributes

  • Name
    campaignName
    Type
    string
    Description

    The WhatsApp campaign name refers to the specific name or title given to a campaign conducted through WhatsApp

Request

POST
   curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
      "from": "91XXXXXXXXXX ", 
      "campaignName": "api-test", 
      "to": "91XXXXXXXXXX",
      "templateName": "template_name",
      "components": {
        "body":{
         "params":["var1", "var2", "var3"]
        } 
        "header":{
          "type":"text",
          "text": "text value"
        }
       },
      "type": "template" 
    }'

Response

{
  "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
  "data": [
  {
  "recipient": "91XXXXXXXXXX",
  "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
  } ],
  "totalCount": 1,
  "message": "Message Sent Successfully!", "error": null
}

POST

Template with header - Image and having variables

For templates with image headers, use this endpoint with customizable parameters for easy integration and tailored content.

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

  • Name
    components
    Type
    string
    Description

    To build a message content object for WhatsApp, typically include various fields such as param, header type(text, images, video, and other media).

  • Name
    body
    Type
    string
    Description

    Template body

  • Name
    params
    Type
    string
    Description

    If you have a registered template with placeholders and you need to submit parameter values in the same order as in the template, you can represent this as an array of values. Ensure that the values are not null, and if the template was registered without placeholders, you can submit an empty array.

  • Name
    Type(header type image)
    Type
    object
    Description

    To comply with the requirements, ensure that the URL provided for the image starts with either "https://" or "http://", and that the image is in one of the supported formats (JPG, JPEG, or PNG) with a maximum size of 5MB.

Optional attributes

  • Name
    campaignName
    Type
    string
    Description

    The WhatsApp campaign name refers to the specific name or title given to a campaign conducted through WhatsApp

Request

POST
   curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
        "from": "91XXXXXXXXXX ",
        "campaignName": "api-test",
        "to": "91XXXXXXXXXX",
        "templateName": "template_name",
        "components": { 
            "body":{
                "params":["var1", "var2", "var3"] 
            },
            "header": {
                "type": " image",
                "image": {
                    "link": "mediaUrl" 
                }
            }
        },
        "type": "template" 
    }'

Response

{
  "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
  "data": [
  {
  "recipient": "91XXXXXXXXXX",
  "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
  } ],
  "totalCount": 1,
  "message": "Message Sent Successfully!", "error": null
}

POSTwaEndpoint

Template with header - Video and having variables

For video-header templates, use this endpoint with customizable parameters for easy integration and personalized adjustments.

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

  • Name
    components
    Type
    string
    Description

    To build a message content object for WhatsApp, typically include various fields such as param, header type(text, images, video, and other media).

  • Name
    body
    Type
    string
    Description

    Template body

  • Name
    params
    Type
    string
    Description

    If you have a registered template with placeholders and you need to submit parameter values in the same order as in the template, you can represent this as an array of values. Ensure that the values are not null, and if the template was registered without placeholders, you can submit an empty array.

  • Name
    Type(header type image)
    Type
    object
    Description

    To comply with the requirements, ensure that the URL provided for the image starts with either "https://" or "http://", and that the image is in one of the supported formats (JPG, JPEG, or PNG) with a maximum size of 5MB.

Optional attributes

  • Name
    campaignName
    Type
    string
    Description

    The WhatsApp campaign name refers to the specific name or title given to a campaign conducted through WhatsApp

Request

POST
   curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
      "from": "91XXXXXXXXXX ", 
      "campaignName": "api-test", 
      "to": "91XXXXXXXXXX",
      "templateName": "template_name",
      "components": {
        "body":{
         "params":["var1", "var2", "var3"]
        } 
        "header":{
          "type":"video",
          "video":{
            "link": "mediaUrl"
          }
        }
       },
      "type": "template" 
    }'

Response

{
  "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
  "data": [
  {
  "recipient": "91XXXXXXXXXX",
  "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
  } ],
  "totalCount": 1,
  "message": "Message Sent Successfully!", "error": null
}

POSTwaEndpoint

Template with header - Document and having variables

This endpoint is for document-header templates, use this endpoint with customizable parameters for seamless integration and personalization.

Required attributes

  • Name
    from
    Type
    string
    Description

    The number registered with WhatsApp business from which the message is to be sent. Ensure that the country code is prefixed to the number. For example, if the number is in the India, the format would be: +91XXXXXXXXXX

  • Name
    templateName
    Type
    string
    Description

    This template name contains only lowercase alphanumeric characters and underscores.

  • Name
    to
    Type
    string
    Description

    Recipient’s MSISDN

  • Name
    type
    Type
    string
    Description

    WhatsApp message templates type

  • Name
    components
    Type
    string
    Description

    To build a message content object for WhatsApp, typically include various fields such as param, header type(text, images, video, and other media).

  • Name
    body
    Type
    string
    Description

    Template body

  • Name
    params
    Type
    string
    Description

    If you have a registered template with placeholders and you need to submit parameter values in the same order as in the template, you can represent this as an array of values. Ensure that the values are not null, and if the template was registered without placeholders, you can submit an empty array.

  • Name
    Type(header type image)
    Type
    object
    Description

    To comply with the requirements, ensure that the URL provided for the image starts with either "https://" or "http://", and that the image is in one of the supported formats (JPG, JPEG, or PNG) with a maximum size of 5MB.

Optional attributes

  • Name
    campaignName
    Type
    string
    Description

    The WhatsApp campaign name refers to the specific name or title given to a campaign conducted through WhatsApp

Request

POST
  curl -G - /v1/whatsapp\
  -H 'apiKey':'string'
  -H "Content-Type: application/json" \
  -d '{
      "from": "91XXXXXXXXXX ", 
      "campaignName": "api-test", 
      "to": "91XXXXXXXXXX",
      "templateName": "template_name",
      "components": {
        "body":{
         "params":["var1", "var2", "var3"]
        } 
        "header":{
          "type":"document",
          "document":{
            "link": "url",
            "filename": "XXXXXXXXXXXXXXX"
          }
        }
       },
      "type": "template" 
    }'

      

Response

{
  "id": "58d63c02-XXXX-XXXX-XXXX-XXXXbb39453",
  "data": [
  {
  "recipient": "91XXXXXXXXXX",
  "messageId": "58d63c02-XXXXX-XXXXX-XXXXX-XXXX9bb39453:1"
  } ],
  "totalCount": 1,
  "message": "Message Sent Successfully!", "error": null
}

Was this page helpful?