JSON format
JSON formats to send the multiple types of messages supported by WhatsApp providers in uContact.
Content
- 1 Contact
- 2 Interactive
- 2.1.1 Action Object
- 2.1.2 Body Object
- 2.1.3 Header Object
- 2.1.4 Section Object
- 2.2 Location Object
- 2.3 Media Object
- 3 Product
- 3.1 Single Product
- 3.2 Multi Product
- 3.3 List
- 3.4 Reply Button
- 4 Template
Contact
Name | Description |
---|---|
object | Optional. Full contact address(es) formatted as an
|
| Optional.
|
object | Optional. Contact email address(es) formatted as an
|
object | Required. Full contact name formatted as a
*At least one of the optional parameters needs to be included along with the |
object | Optional. Contact organization information formatted as an
|
object | Optional. Contact phone number(s) formatted as a
|
object | Optional. Contact URL(s) formatted as a
|
{
"addresses": [{
"street": "STREET",
"city": "CITY",
"state": "STATE",
"zip": "ZIP",
"country": "COUNTRY",
"country_code": "COUNTRY_CODE",
"type": "HOME"
},
{
"street": "STREET",
"city": "CITY",
"state": "STATE",
"zip": "ZIP",
"country": "COUNTRY",
"country_code": "COUNTRY_CODE",
"type": "WORK"
}],
"birthday": "YEAR_MONTH_DAY",
"emails": [{
"email": "EMAIL",
"type": "WORK"
},
{
"email": "EMAIL",
"type": "HOME"
}],
"name": {
"formatted_name": "NAME",
"first_name": "FIRST_NAME",
"last_name": "LAST_NAME",
"middle_name": "MIDDLE_NAME",
"suffix": "SUFFIX",
"prefix": "PREFIX"
},
"org": {
"company": "COMPANY",
"department": "DEPARTMENT",
"title": "TITLE"
},
"phones": [{
"phone": "PHONE_NUMBER",
"type": "HOME"
},
{
"phone": "PHONE_NUMBER",
"type": "WORK",
"wa_id": "PHONE_OR_WA_ID"
}],
"urls": [{
"url": "URL",
"type": "WORK"
},
{
"url": "URL",
"type": "HOME"
}]
}
Interactive
Name | Description |
---|---|
object | Required. Action you want the user to perform after reading the message. |
object | Optional for type An object with the body of the message.
The
|
object | Optional. An object with the footer of the message.
The
|
object | Required for type Header content displayed on top of a message. You cannot set a header if your interactive object is of |
object | Required. The type of interactive message you want to send. Supported values:
|
The following objects are nested inside the interactive
object:
Footer object
Action Object
Name | Description |
---|---|
string | Required for List Messages. Button content. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not.
Maximum length: 20 characters. |
array of objects | Required for Reply Buttons. A button object can contain the following parameters:
You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID. |
string | Required for Single Product Messages and Multi-Product Messages. Unique identifier of the Facebook catalog linked to your WhatsApp Business Account. This ID can be retrieved via the Meta Commerce Manager. |
string | Required for Single Product Messages and Multi-Product Messages. Unique identifier of the product in a catalog.
To get this ID go to Meta Commerce Manager and select your Meta Business account. You will see a list of shops connected to your account. Click the shop you want to use. On the left-side panel, click Catalog > Items, and find the item you want to mention. The ID for that item is displayed under the item's name. |
array of objects | Required for List Messages and Multi-Product Messages. Array of |
Body Object
Nombre | Descripción |
---|---|
| Obligatorio para las plantillas de mensaje. Tipo de mensaje que se envía.
|
| Obligatorio. Identificador de WhatsApp al que se enviará el mensaje. |
| Opcional. A partir de la versión
Acepta una cadena con el formato de duración ISO-8601 o, simplemente, en segundos. Las duraciones se deben especificar con un múltiplo exacto de días. Cualquier otro valor se redondea automáticamente al día más próximo. Consulta la sección del objeto |
| Opcional. Valor: |
| Obligatorio para los mensajes de tipo Contiene toda la información de la plantilla. |
| Obligatorio para las plantillas de mensaje. Elemento que incluye el contenido del mensaje. Indica que el mensaje está bien estructurado. Los parámetros incluidos proporcionan la estructura. |
Header Object
Name | Description |
---|---|
object | Required if Contains the media object for this document. |
object | Required if Contains the media object for this image. |
string | Required if Text for the header. Formatting allows emojis, but not markdown.
Maximum length: 60 characters. |
string | Required. The header type you would like to use. Supported values:
|
object | Required if Contains the media object for this video. |
Section Object
Name | Description |
---|---|
array of objects | Required for Multi-Product Messages. Array of
Each
|
array of objects | Required for List Messages. Contains a list of rows. You can have a total of 10 rows across your sections.
Each row must have a title (Maximum length: 24 characters) and an ID (Maximum length: 200 characters). You can add a description (Maximum length: 72 characters), but it is optional.
Example: "rows": [
{
"id":"unique-row-identifier-here",
"title": "row-title-content-here",
"description": "row-description-content-here",
}
] |
string | Required if the message has more than one section. Title of the section.
Maximum length: 24 characters. |
Location Object
Name | Description |
---|---|
| Required. Longitude of the location. |
| Required. Latitude of the location. |
| Optional. Name of the location. |
| Optional. Address of the location. Only displayed if |
Media Object
See Get Media ID for information on how to get the ID of your media object. For information about supported media types for Cloud API, see Supported Media Types.
Name | Description |
---|---|
string | Required when The media object ID. Do not use this field when message |
string | Required when The protocol and URL of the media to be sent. Use only with HTTP/HTTPS URLs.
Do not use this field when message
Cloud API users only:
|
string | Optional. Describes the filename for the specific document. Use only with The extension of the filename will specify what format the document is displayed as in WhatsApp. |
string | Optional. Only used for On-Premises API. This path is optionally used with a |
Product
Single Product
{
"messaging_product": "whatsapp",
"recipient_type": "individual",
"to": "PHONE_NUMBER",
"type": "interactive",
"interactive": {
"type": "product",
"body": {
"text": "optional body text"
},
"footer": {
"text": "optional footer text"
},
"action": {
"catalog_id": "CATALOG_ID",
"product_retailer_id": "ID_TEST_ITEM_1"
}
}
}
Multi Product
List
Reply Button
Template
Name | Description |
---|---|
| Required. Name of the template. |
object | Required. Contains a
The
|
array of objects | Optional. Array of |
| Optional. Only used for On-Premises API. Namespace of the template. |