WhatsApp channel properties

There are WhatsApp channel-specific properties that can be used when making calls to the Conversation API. These properties can be listed under channel_properties in the message request.

WhatsApp Preview URL

WHATSAPP_PREVIEW_URL allows customers to control whether a message containing a URL will show the URL preview or not.

Supported message types:

  • Text Messages

Below is the code example for adding the channel specific property WHATSAPP_PREVIEW_URL to a Conversation API call:

Copy
Copied
{
  "app_id": "{APP_ID}",
  "recipient":
  {
    "contact_id": "{CONTACT_ID}"
  },
  "message":
  {
    "text_message":
    {
      "text": "This is a text message from the Sinch Conversation API. https://www.sinch.com"
    }
  },
  "channel_properties": {
    "WHATSAPP_PREVIEW_URL": "false"
  }
}

WhatsApp Direct Send Category

WHATSAPP_DIRECT_SEND_CATEGORY allows customers to specify the WhatsApp Direct Send Category.

If defined, the request will be sent through the WhatsApp Direct Send API. See WhatsApp Direct API Support for more information.

Below is a text message code sample for adding the channel specific property WHATSAPP_DIRECT_SEND_CATEGORY to a Conversation API call:

Copy
Copied
{
  "app_id": "{APP_ID}",
  "recipient":
  {
    "contact_id": "{CONTACT_ID}"
  },
  "message":
  {
    "text_message":
    {
      "text": "This is a text message from the Sinch Conversation API. https://www.sinch.com"
    }
  },
  "channel_properties": {
    "WHATSAPP_DIRECT_SEND_CATEGORY": "utility"
  }
}

The relevant WhatsApp channel properties are detailed in the table below:

Property name Property value
WHATSAPP_PREVIEW_URL Defines whether to include a preview of the URL or not. Possible values: true, false. Default value: true.
WHATSAPP_DIRECT_SEND_CATEGORY If defined, the request is sent through the WhatsApp Direct Send API. Possible values: utility. By default, requests are sent through the WhatsApp Cloud API.
We'd love to hear from you!
Rate this content:
Still have a question?
 
Ask the community.