Example of WhatsApp Message request

JSON

Example of template Message request:

{
  "phone_number": 380961111111,
  "extra_id": "AD-6640-7006",
  "callback_url": "https://send-dr-here.com",
  "start_time": "2020-12-12 10:10:10+03:00",
  "tag": "Campaign name",
  "channels": [
    "whatsapp"
  ],
  "channel_options": {
    "whatsapp": {
      "text": " Templated text for WhatsApp",
      "ttl": 604800
    }
  }
}

Example of non-template (Session) Message request :

{
  "phone_number": 380961111111,
  "extra_id": "AD-6640-7006",
  "callback_url": "https://send-dr-here.com",
  "start_time": "2020-12-12 10:10:10+03:00",
  "tag": "Campaign name",
  "channels": [
    "whatsapp"
  ],
  "channel_options": {
    "whatsapp": {
      "text": "Session text for WhatsApp",
      "img": "https://example.com/image.png",
      "img_name": "Name for image",
      "doc": "https://example.com/file.docx",
      "doc_name": "Name for document",
      "audio": "https://example.com/audio.mp3",
      "video": "https://example.com/video.mp4",
      "video_name": "Name for video",
      "latitude": "50.438820",
      "longitude": "30.498916",
      "ttl": 604800
    }
  }
}

XML

Example of template Message request:

<?xml version="1.0" encoding="UTF-8" ?>
<message>
  <phone_number>380961111111</phone_number>
  <extra_id>AD-6640-7006</extra_id>
  <callback_url>https://send-dr-here.com</callback_url>
  <start_time>2020-12-12 10:10:10+03:00</start_time>
  <tag>Campaign name</tag>
  <channels>
    <channel>whatsapp</channel>
  </channels>
  <channel_options>
    <whatsapp>
      <text>Templated text for WhatsApp</text>
      <ttl>604800</ttl>
    </whatsapp>
  </channel_options>
</message>

Example of non-template Message request:

<?xml version="1.0" encoding="UTF-8" ?>
<message>
  <phone_number>380110000000</phone_number>
  <extra_id>AD-6640-7006</extra_id>
  <callback_url>https://send-dr-here.com</callback_url>
  <start_time>2016-10-26 14:10:10</start_time>
  <tag>GMSU</tag>
  <channels>
    <channel>whatsapp</channel>
  </channels>
  <channel_options>
    <whatsapp>
      <text>Session text for WhatsApp</text>
      <img>https://example.com/image.png</img>
      <img_name>Name for image</img_name>
      <doc>https://example.com/file.docx</doc>
      <doc_name>Name for document</doc_name>
      <audio>https://example.com/audio.mp3</audio>
      <video>https://example.com/video.mp4</video>
      <video_name>Name for video</video_name>
      <latitude>50.438820</latitude>
      <longitude>30.498916</longitude>
      <ttl>604800</ttl>
    </whatsapp>
  </channel_options>
</message>