WhatsApp/SMS providers format

WhatsApp/SMS providers format

This page provides a detailed reference on the JSON formats intended for WhatsApp provider messages. All message types available, excluding text and images, are presented here for you to send. To date, the integration has been successfully carried out with Gupshup and Infobip.


Interactive Buttons

Properties

Property

Description

Required

header

Contains the properties of the top part of the element.

Yes

text

Contains the text included in the header.

Yes*

imageUrl

Contains the URL of the image in the header.

Yes*

videoUrl

Contains the URL of the video in the header.

Yes*

documentUrl

Contains the URL of the document location.

Yes*

filename

File name to send document type.

No

body

Contains the text that will appear below the header.

Yes

buttonsList

Contains an array with the buttons. (1-3)

Yes

button

Button information.

  • id

  • title

Yes

Yes

Yes

footer

Contains the text that was in the footer of the element.

No

*Only one of these properties is required, depending on what the interactive button header type will be. Ex: imageUrl > Image Type, text > Text Type, etc.


Text

{   "interactiveButtons": {     "header": {       "text": "text"     },     "body": "body text",     "buttonsList": [       {         "id": "1",         "title": "Si"       },       {         "id": "2",         "title": "No"       }     ],     "footer": "footer"   } }

Document

{   "interactiveButtons": {     "header": {       "documentUrl": "https://integraccs.ucontactcloud.com/attachments/20220201/000ESPMarcadores.pdf",       "filename": "Marcadores"     },     "body": "body text",     "buttonsList": [       {         "id": "1",         "title": "Si"       },       {         "id": "2",         "title": "No"       }     ],     "footer": "footer"   } }

Image

{   "interactiveButtons": {     "header": {       "imageUrl": "https://integraccs.ucontactcloud.com/attachments/20220201/e2f3323a-2cb3-4ff7-9e81-1ff4ce893d26.logo192.png"     },     "body": "body text",     "buttonsList": [       {         "id": "1",         "title": "Si"       },       {         "id": "2",         "title": "No"       }     ],     "footer": "footer"   } }

Video

{   "interactiveButtons": {     "header": {       "videoUrl": "https://integraccs.ucontactcloud.com/attachments/20220201/e2f3323a-2cb3-4ff7-9e81-1ff4ce893d26.sample.mp4"     },     "body": "body text",     "buttonsList": [       {         "id": "1",         "title": "Si"       },       {         "id": "2",         "title": "No"       }     ],     "footer": "footer"   } }

Interactive List

Properties

Property

Description

Required

header

Text located in the header of the element.

No

body

Text located below the header.

Yes

buttonMenu

Text on the button to open the menu.

Yes

sections

Array with sections (1-2).

Yes

title

Title for each section.

No*

rows

Array with the different options.

Yes

row

Information about each option:

  • id

  • title

  • description

Yes

  • Yes

  • Yes

  • No

footer

Text located in the footer of the element.

No

*Required if you have more than one section.

The range of options for each section is 1-10. Max between the sections is 10.

{   "interactiveList": {     "header": "Header",     "body": "Some text",     "buttonMenu": "Choose one",     "sections": [       {         "title": "First section title",         "rows": [           {             "id": "1",             "title": "first row title",             "description": "first row description"           },           {             "id": "2",             "title": "second row title",             "description": "second row description"           }         ]       },       {         "title": "Second section title",         "rows": [           {             "id": "3",             "title": "third row title"           }         ]       }     ],   "footer": "Footer"   } }

Contact

Properties

Property

Description

Required

firstName

First name

Yes

lastName

Last name.

No

middleName

Middle name.

No

formattedName

Name and last name without blank spaces.

Yes

namePrefix

Name prefix.

No

birthday

Birthday

No

phones

Array with different phone numbers.

No

phone

Number and phone type

  • type

  • phone

No

emails

Array with different email addresses.

No

email

Email address and type.

  • email

  • type

No

addresses

Array with different addresses.

No

address

Information of each address.

  • type

  • street

  • city

  • country

  • zip

  • state

No

org

Information about the organization.

  • company

  • department

  • title

No

urls

Array with different URLs.

No

url

  • url 

  • type

No

{   "contact": {     "firstName": "Test",     "lastName": "Integra",     "formattedName": "TestIntegra",     "namePrefix": "Mr",     "middleName": "Algo",     "birthday": "2022-01-21",     "phones": [       {         "type": "WORK",         "phone": "308740239"       }     ],     "emails": [       {         "email": "testing@integraccs.com",         "type": "WORK"       }     ],     "addresses": [       {         "type": "WORK",         "street": "Paseo de la Carretas",         "city": "Montevideo",         "country": "Uruguay",         "zip": "11800",         "state": "MV"       }     ],     "org": {       "company": "Integra",       "department": "Development",       "title": "Senior Developer"     },     "urls": [       {         "url": "https://www.net2phone.com",         "type": "WORK"       }     ]   } }

Location

Properties

Property

Description

Required

address

Place on the map: street and city.

No

name

Name of the location.

No

latitude

Specific north-south coordinate.

Yes

longitude

Specific east-west coordinate.

Yes

{   "location": {     "address": "Bv. Gral. Artigas 1825 Departamento de Montevideo",     "name": "Tres Cruces Shopping",     "latitude": "-34.8938251",     "longitude": "-56.1685413"   } }

Call to Action (Gupshup and Gupshup v3 Exclusive)

CTA URL buttons allow a brand to map any URL to a button so that the raw URL is not directly included in the interactive message body. After receiving the message, consumers can click on the CTA button and the given link will be opened in their default browser.

The message type can be video, image or text.

Propiedad

Tipo

Requerido

Descripción

Propiedad

Tipo

Requerido

Descripción

body

text

Yes

Message text

type

text

Yes

Message type

button_text

text

Yes

Text present on the button

url

text

Yes

URL where the button redirects

footer

text

No

Message footer

mediaUrl

text

No*

Image or video URL

*Required if type is image or video

{ "CTA":{ "body":"prueba", "type":"video", "button_text":"Visit page", "footer":"footer", "url":"www.net2phone.com", "mediaUrl":"<https://elearning.ucontactcloud.com/attachments/20240909/86aa0229-2b7b-484a-8393-fc8a7c2bf020.uContact.mp4>" } }

Templates/HSM

Gupshup and WhatsApp Business

Properties

Properties

Description

Required

name

Approved template number or ID by WhatsApp.

Yes

type

Type of template.

Yes

language

Template language.

Yes

contentHeader

Header file URL.

Depends: It is required for those templates that have header of type image, video, or file.

headerPlaceholders

Arrange with the variables of the header text.

Depends: This applies to templates with a text header that includes variables.

filename

Name to which the sent document will arrive at its destination.

No: If left empty, the name will be “null”.

placeholders

Arrangement with the variables of the body text of the template.

Depends: It is required when there are variables in the body of the template.

buttons

Array of objects that contains the properties:

  • index: position starting from 0 of the button.

  • text: Value of the variable within the button to be replaced.

  • type: type of button.

Depends: This arrangement should only be made for the buttons that contain variables.

Text

Template with a header with variables and a body with variables.

{     "template":{         "name":"0e05d104-4efd-4363-8c90-69eaca8b0c0d",         "type":"text", "language":"en",         "placeholders":[             "phone",             "86565887",             "updates"         ] "headerPlaceholders":[             "Juan",             "Marquez"         ]     } }

Buttons

Template with a header with variables, body with variables, and buttons with variables (it has 3 buttons and only the first and last have variables).

{     "template":{         "name":"0e05d104-4efd-4363-8c90-69eaca8b0c0d",         "type":"text", "language":"en",         "placeholders":[             "phone",             "86565887",             "updates"         ], "headerPlaceholders":[             "Juan",             "Marquez"         ], "buttons" : [ { "index" : 0, "text" : "productos", "type" : "URL" }, { "index" : 2, "text" : "ucontact", "type" : "COPY_CODE" } ]     } }


Video

{     "template":{         "name":"3af461ef-2799-479a-9d8e-d0bff1bf851a",         "type":"video", "language":"en",         "placeholders":[             "Matias",             "Account"         ], "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220201/1ae7ef92-0775-4b88-91f8-db2ba1a20000.mp4"     } }

Image

 

{   "template": {     "name": "a730dd25-845c-4f99-823a-a495b751ce67",     "type": "image", "language":"en",     "placeholders": ["Matias", "07/02/2022","Admin"],     "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220203/19cd82ad-fb36-4414-8c60-fe1be13b4f2c.jpeg"   } }

Document

{     "template":{         "name":"a730dd25-845c-4f99-823a-a495b751ce67",         "type":"document",         "language":"en",         "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220202/d065eed9-dac7-400c-aa38-d9d0b13e1036.000ESPMarcadores.pdf",         "filename":"Dialers"     } }

 

Infobip

Property

Description

Required

name

Name or id of the approved template.

Yes

type

Template type.

Yes

language

Template language.

Yes

contentHeader

Text included in the header.

Yes(1)

latitude

Specific north-south coordinate.

Yes(2)

longitude

Specific east-west coordinate.

Yes(2)

filename

Document name.

No(3)

placeholders

Array with variables in template text.

Yes(4)

buttonType

Button type (URL or QUICK_REPLY).

Yes(4)

buttonsList

Array with variables for the text on the button.

Yes(4)

1: Depending on the type, Ex: in the case of an image, the URL of the image must go.

2: Required if type is location.

3: If you leave it empty, the name will be “null”.

4: Required if the template contains variables or buttons, it must be the exact number of elements in the array.

Body

{     "template":{         "name":"infobip_test_hsm_2",         "type":"Body",         "language":"en_US",         "placeholders":[          "John",           "john@gmail.com"         ]     } }

Video

{     "template":{         "name":"instruction_video",         "type":"video",         "language":"en",         "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220201/1ae7ef92-0775-4b88-91f8-db2ba1a20000.mp4"     } }

Image

{     "template":{         "name":"boarding_pass",         "type":"Image",         "language":"en",         "placeholders":[             "1899"         ],         "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220201/f3038b7c-2ef7-4d5f-821a-27942c072926.jpeg"     } }

Image/Button

{     "template":{         "name":"registration_success",         "type":"Image",         "language":"en",         "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220201/f3038b7c-2ef7-4d5f-821a-27942c072926.jpeg",         "placeholders":[                 "var1",                 "var2",                 "var3",                 "var4"         ],         "buttonType":"QUICK_REPLY",         "buttonsList":[             "test",             "test2",             "test3"         ]     } }

Location

{     "template":{         "name":"delivery_notification",         "type":"Location",         "language":"en",         "placeholders":[                 "38"         ],         "latitude":"-34.739603",         "longitude":"-56.088259"     } }

Document

{     "template":{         "name":"e_receipt",         "type":"Document",         "language":"en",         "contentHeader": "https://integraccs.ucontactcloud.com/attachments/20220202/d065eed9-dac7-400c-aa38-d9d0b13e1036.000ESPMarcadores.pdf",         "filename":"Dialers"     } }