Formato de proveedores WhatsApp

Formato de proveedores WhatsApp

Esta página ofrece una detallada referencia sobre los formatos JSON destinados a los mensajes de proveedores de WhatsApp. Aquí se presentan todos los tipos de mensajes disponibles. Hasta la fecha, la integración ha sido exitosamente llevada a cabo con Gupshup, Infobip y ciertos tipos de mensajes para Whatsapp Business.


Botones Interactivos

Propiedades

Propiedad

Descripción

Requerido

header

Contiene las propiedades de la parte superior del elemento.

Si

text

Contiene el texto incluido en la cabecera.

Si*

imageUrl

Contiene la URL de la imagen en la cabecera.

Si*

videoUrl

Contiene la URL del video en la cabecera.

Si*

documentUrl

Contiene la URL de la ubicación del documento.

Si*

filename

Nombre del archivo para enviar tipo documento.

No

body

Contiene el texto que aparecerá debajo de la cabecera.

Si

buttonsList

Contiene un array con los botones. (1-3)

Si

button

Información del botón.

  • id

  • title

Si

Si

Si

footer

Contiene el texto que era en el pie del elemento.

No

*Solo una de estas propiedades es requerida, dependiendo de cuál será el tipo de la cabecera de los botones interactivos. Ej: imageUrl > Tipo Imagen, text > Tipo texto, etc.


Texto

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

Documento

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

Imagen

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

Lista de botones interactiva

Propiedades

Propiedad

Descripción

Requerido

header

Texto ubicado en la cabecera del elemento.

No

body

Texto ubicado por debajo de la cabecera.

Si

buttonMenu

Texto en el botón para abrir el menú.

Si

sections

Arreglo con las secciones (1-2).

Si

title

Título para cada sección.

No*

rows

Arreglo con las diferentes opciones.

Si

row

Información de cada opción:

  • id

  • title

  • description

Si

  • Si

  • Si

  • No

footer

Texto ubicado en el pie del elemento.

No

*Requerido en caso de tener más de una sección.

El rango de opciones de cada sección es de 1-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"   } }

Contacto

Propiedades

Propiedad

Descripción

Requerido

firstName

Primer nombre.

Si

lastName

Apellido.

No

middleName

Nombre del medio.

No

formattedName

Nombre y apellido sin espacio.

Si

namePrefix

Prefijo usado en el nombre.

No

birthday

Fecha de nacimiento.

No

phones

Arreglo con los distintos teléfonos.

No

phone

Número y tipo del teléfono.

  • type

  • phone

No

emails

Arreglo con los distintos emails.

No

email

Dirección de correo y el tipo.

  • email

  • type

No

addresses

Arreglo con los distintas direcciones.

No

address

Información de cada dirección.

  • type

  • street

  • city

  • country

  • zip

  • state

No

org

Información de la organización donde trabaja.

  • company

  • department

  • title

No

urls

Arreglo con los diferentes 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"       }     ]   } }

Ubicación

Propiedades

Propiedad

Descripción

Requerido

address

Dirección del lugar en el mapa: calle y ciudad.

No

name

Nombre del lugar.

No

latitude

Coordenada específica norte-sur.

Si

longitude

Coordenada específica este-oeste.

Si

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

Call to Action (solo Gupshup y Gupshup V3)

Los botones de URL de CTA permiten a una marca asignar cualquier URL a un botón para que la URL sin formato no se incluya directamente en el cuerpo del mensaje interactivo. Después de recibir el mensaje, los consumidores pueden hacer clic en el botón CTA y el enlace proporcionado se abrirá en su navegador predeterminado.

El tipo puede ser video, imagen o texto.

Propiedades

Propiedad

Tipo

Requerido

Descripción

Propiedad

Tipo

Requerido

Descripción

body

texto

Si

Texto del mensaje

type

texto

Si

Tipo del mensaje

button_text

texto

Si

Texto presente en el botón

url

texto

Si

URL donde se redirige el boton

footer

texto

No

Footer del mensaje

mediaUrl

texto

No*

Url del video o imagen.

*Requerido si el tipo es imagen o video

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

 

Templates/HSM

Gupshup y Whatsapp Business

Propiedades

Propiedad

Descripción

Requerido

name

Nombre o id del template aprobado por WhatsApp.

Si

type

Tipo del template.

Si

language

Lenguaje del template.

Si

contentHeader

URL del archivo del encabezado.

Si: Es requerido para aquellos templates que tengan variables en el encabezado de tipo imagen, video o archivo.

headerPlaceholders

Arreglo con las variables del texto del encabezado.

Si: Es requerido para aquellos templates que tengan un encabezado y este contenga variables en el texto.

filename

Nombre del documento.

No: En caso de dejarlo vacío el nombre será “null”.

placeholders

Arreglo con las variables del texto del cuerpo del template.

Si: Es requerido cuando se tienen variables en el cuerpo del template.

buttons

Arreglo de objetos que contiene las propiedades:

  • index: posición arrancando desde 0 del botón.

  • text: Valor de la variable dentro del botón a reemplazar.

  • type: tipo de boton.

Si: Se debe de tener esta arregló solo para los botones que contengan variables.

Text

Template con un encabezado con variables y un cuerpo con variables.

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

Botones

Template con un encabezado con variables, cuerpo con variables y botones con variables (tiene 3 botones y solo el primero y el ultimo tienen variables).

{     "template":{         "name":"0e05d104-4efd-4363-8c90-69eaca8b0c0d", "language":"en",         "type":"text",         "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"     } }

Imagen

 

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

Documento

{     "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":"Marcadores"     } }

 

 

Infobip

Propiedad

Descripción

Requerido

name

Nombre o id del template aprobado por WhatsApp.

Si

type

Tipo del template.

Si

language

Lenguaje del template.

Si

contentHeader

Texto incluido en la cabecera.

Si(1)

latitude

Coordenada específica norte-sur.

Si(2)

longitude

Coordenada específica este-oeste.

Si(2)

filename

Nombre del documento.

No(3)

placeholders

Arreglo con las variables en el texto del template.

Si(4)

buttonType

Tipo de botón (URL o QUICK_REPLY).

Si(4)

buttonsList

Arreglo con variables para el texto en el botón.

Si(4)

1: Dependiendo el tipo, Ej: en caso de imagen debe ir la URL de la imagen.

2: Requerido si el tipo es location.

3: En caso de dejarlo vacío el nombre será “null”.

4: Requerido si el template contiene variables o botones, debe ser el número exacto de elementos en el 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"     } }

Imagen/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"     } }

Documento

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

 

Carousel (MM Lite / Gupshup v3 Exclusive)

Las plantillas de carrusel son plantillas de la categoría MARKETING preaprobadas por Meta. Se envían únicamente a través de la clave marketingPassthrough y no requieren sincronización en uContact.

Cómo usar el marketing passthrough:

{ "marketingPassthrough": { "template": { "name": "carrusell_vars", "language": { "code": "es" }, "components": [ { "type": "body", "parameters": [ { "type": "text", "text": "John" } ] }, { "type": "carousel", "cards": [ { "card_index": 0, "components": [ { "type": "header", "parameters": [ { "type": "image", "image": { "link": "https://example.com/image1.jpg" } } ] }, { "type": "body", "parameters": [ { "type": "text", "text": "Product A" }, { "type": "text", "text": "$99" } ] }, { "type": "button", "sub_type": "url", "index": 0, "parameters": [ { "type": "text", "text": "product-a" } ] } ] } ] } ] } } }