JSON format

JSON formats to send the multiple types of messages supported by WhatsApp providers in uContact.

Contact

Name

Description

Name

Description

addresses

object

Optional.

Full contact address(es) formatted as an addresses object. The object can contain the following fields:

streetstringOptional. Street number and name.

citystringOptional. City name.

statestringOptional. State abbreviation.

zipstringOptional. ZIP code.

countrystringOptional. Full country name.

country_codestringOptional. Two-letter country abbreviation.

typestringOptional. Standard values are HOME and WORK.

birthday

Optional.

YYYY-MM-DD formatted string.

emails

object

Optional.

Contact email address(es) formatted as an emails object. The object can contain the following fields:

emailstringOptional. Email address.

typestringOptional. Standard values are HOME and WORK.

name

object

Required.

Full contact name formatted as a name object. The object can contain the following fields:

formatted_namestringRequired. Full name, as it normally appears.

first_namestringOptional*. First name.

last_namestringOptional*. Last name.

middle_namestringOptional*. Middle name.

suffixstringOptional*. Name suffix.

prefixstringOptional*. Name prefix.

 

*At least one of the optional parameters needs to be included along with the formatted_name parameter.

org

object

Optional.

Contact organization information formatted as an org object. The object can contain the following fields:

companystringOptional. Name of the contact's company.

departmentstringOptional. Name of the contact's department.

titlestringOptional. Contact's business title.

phones

object

Optional.

Contact phone number(s) formatted as a phone object. The object can contain the following fields:

phonestringOptional. Automatically populated with the `wa_id` value as a formatted phone number.

typestringOptional. Standard Values are CELL, MAIN, IPHONE, HOME, and WORK.

wa_idstringOptional. WhatsApp ID.

urls

object

Optional.

Contact URL(s) formatted as a urls object. The object can contain the following fields:

urlstringOptional. URL.

typestringOptional. Standard values are HOME and WORK.

{ "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

Name

Description

action

object

Required.

Action you want the user to perform after reading the message.

body

object

Optional for type product. Required for other message types.

An object with the body of the message.

 

The body object contains the following field:

textstringRequired if body is present. The content of the message. Emojis and markdown are supported. Maximum length: 1024 characters.

footer

object

Optional. An object with the footer of the message.

 

The footer object contains the following field:

textstringRequired if footer is present. The footer content. Emojis, markdown, and links are supported. Maximum length: 60 characters.

header

object

Required for type product_list. Optional for other types.

Header content displayed on top of a message. You cannot set a header if your interactive object is of product type. See header object for more information.

type

object

Required.

The type of interactive message you want to send. Supported values:

 

  • button: Use it for Reply Buttons.

  • list: Use it for List Messages.

  • product: Use for Single Product Messages.

  • product_list: Use for Multi-Product Messages.

The following objects are nested inside the interactive object:

Action Object

Name

Description

Name

Description

button

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.

buttons

array of objects

Required for Reply Buttons.

A button object can contain the following parameters:

 

  • type: only supported type is reply (for Reply Button)

  • title: Button title. It cannot be an empty string and must be unique within the message. Emojis are supported, markdown is not. Maximum length: 20 characters.

  • id: Unique identifier for your button. This ID is returned in the webhook when the button is clicked by the user. Maximum length: 256 characters.

You can have up to 3 buttons. You cannot have leading or trailing spaces when setting the ID.

catalog_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.

product_retailer_id

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.

sections

array of objects

Required for List Messages and Multi-Product Messages.

Array of section objects. Minimum of 1, maximum of 10. See section object.

Body Object

Nombre

Descripción

Nombre

Descripción

type

Obligatorio para las plantillas de mensaje.

Tipo de mensaje que se envía.
Opciones:

  • text: opción predeterminada

  • image

  • audio

  • document

  • template: usa esta opción para enviar un mensaje de plantilla multimedia.

  • hsm

to

Obligatorio.

Identificador de WhatsApp al que se enviará el mensaje.

ttl
Quedará obsoleto en la versión v2.35.

Opcional.

A partir de la versión v2.21.3: duración del tiempo de vida (TTL).
Valor predeterminado: 7 días
Otras opciones: Las duraciones mínima y máxima compatibles oscilan entre 1 y 30 días (ambos valores incluidos).

 

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 ttl para obtener más información.

recipient_type

Opcional.

Valor:individual

template

Obligatorio para los mensajes de tipo template.

Contiene toda la información de la plantilla.

hsm

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