Enviar mensagens interativas
Para enviar mensagens usando recursos interativos, também seguiremos o formato JSON BASE. O objeto de mensagem deve ter um único campo:interactive
Mensagem
interativo
Sim
Campo usado para enviar uma mensagem interativa
Interativo
Exemplo de solicitação de mensagem de lista de vários produtos
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"sections": [
{
"title": "Cakes",
"productItems": [
{
"productRetailerId": "product-1-SKU"
},
{
"productRetailerId": "product-2-SKU"
}
]
},
{
"title": "Juices",
"productItems": [
{
"productRetailerId": "product-3-SKU"
},
{
"productRetailerId": "product-4-SKU"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"sections": [
{
"title": "Cakes",
"productItems": [
{
"productRetailerId": "product-1-SKU"
},
{
"productRetailerId": "product-2-SKU"
}
]
},
{
"title": "Juices",
"productItems": [
{
"productRetailerId": "product-3-SKU"
},
{
"productRetailerId": "product-4-SKU"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"sections": [
{
"title": "Cakes",
"productItems": [
{
"productRetailerId": "product-1-SKU"
},
{
"productRetailerId": "product-2-SKU"
}
]
},
{
"title": "Juices",
"productItems": [
{
"productRetailerId": "product-3-SKU"
},
{
"productRetailerId": "product-4-SKU"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"sections": [
{
"title": "Cakes",
"productItems": [
{
"productRetailerId": "product-1-SKU"
},
{
"productRetailerId": "product-2-SKU"
}
]
},
{
"title": "Juices",
"productItems": [
{
"productRetailerId": "product-3-SKU"
},
{
"productRetailerId": "product-4-SKU"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"sections": [
{
"title": "Cakes",
"productItems": [
{
"productRetailerId": "product-1-SKU"
},
{
"productRetailerId": "product-2-SKU"
}
]
},
{
"title": "Juices",
"productItems": [
{
"productRetailerId": "product-3-SKU"
},
{
"productRetailerId": "product-4-SKU"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
Exemplo de solicitação de mensagem de lista de produto único
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"productRetailerId": "product-sku"
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"productRetailerId": "product-sku"
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"productRetailerId": "product-sku"
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"productRetailerId": "product-sku"
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "PRODUCT_LIST",
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"productListAction": {
"catalogId": "catalog-id",
"productRetailerId": "product-sku"
},
"alternativeText": "Simple message text"
}
}
}
Interativo
messageInteractiveType
Sim
Tipo da mensagem interativa. Opções disponíveis: , e PRODUCT_LISTLISTREPLY_BUTTON
String
header
Necessário para mensagens de vários produtos. Negado para mensagens de produto único. Opcional para outros tipos
Conteúdo do cabeçalho
Header
body
Sim, exceto para mensagens de produto único
Texto principal
Body
footer
Não
Texto do rodapé
Footer
productListAction
Quando o tipo interativo é PRODUCT_LIST
Contém os parâmetros de tipo interativo
ProductListAction
listAction
Quando o tipo interativo é LIST
Contém os parâmetros de tipo interativo
ListAction
replyButtonAction
Quando o tipo interativo é REPLY_BUTTON
Contém os parâmetros de tipo interativo
ReplyButtonAction
alternativeText
Não
Texto que será enviado caso o destino não suporte Mensagem Interativa
String
Exatamente um desses campos deve ser preenchido
Os tipos de mensagem interativa 'LIST' e 'PRODUCT_LIST' aceitam apenas o campo 'texto'
'MENSAGENS DA LISTA ÚNICA DE PRODUTOS' NÃO aceita o campo 'cabeçalho'
Corpo/Rodapé
text
Sim
Não pode ser uma String vazia. Permite Emojis & markdown.
Corpo: Max 1024 caracteres, espaço em branco é cortado. Rodapé: Max 60 caracteres.
String
ProductListAction (para mensagens de produto único)
catalogId
Sim
O catalogId configurado no Gerenciador de Negócios
String
productRetailerId
Sim
A ID do produto configurada no Gerenciador de Negócios
String
ProductListAction (para mensagens de vários produtos)
catalogId
Sim
O catalogId configurado no Gerenciador de Negócios
String
sections
Sim
Matriz de pelo menos uma Seção. Mínimo de 1 e máximo de 10.
Section []
Exemplo de solicitação de mensagem de lista
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"listAction": {
"button": "button text",
"sections": [
{
"title": "Section One",
"rows": [
{
"identifier": "9ab8d65e-d389-4123-b97b-702e658cc9e4",
"title": "August 7, 11:00",
"description": "Saturday, August 7, 2021. 11:00AM"
},
{
"identifier": "2051afef-e000-47d0-99a5-7d96c17968b2",
"title": "August 7, 15:00",
"description": "Saturday, August 7, 2021. 3:00PM"
},
{
"identifier": "55baac93-a513-45d0-ad9e-2e2271861fc8",
"title": "August 9, 11:00",
"description": "Monday, August 9, 2021. 11:00AM"
},
{
"identifier": "e2703f03-689c-4d1e-b0e9-4045d6687605",
"title": "August 9, 15:00",
"description": "Monday, August 9, 2021. 4:00PM"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"listAction": {
"button": "button text",
"sections": [
{
"title": "Section One",
"rows": [
{
"identifier": "9ab8d65e-d389-4123-b97b-702e658cc9e4",
"title": "August 7, 11:00",
"description": "Saturday, August 7, 2021. 11:00AM"
},
{
"identifier": "2051afef-e000-47d0-99a5-7d96c17968b2",
"title": "August 7, 15:00",
"description": "Saturday, August 7, 2021. 3:00PM"
},
{
"identifier": "55baac93-a513-45d0-ad9e-2e2271861fc8",
"title": "August 9, 11:00",
"description": "Monday, August 9, 2021. 11:00AM"
},
{
"identifier": "e2703f03-689c-4d1e-b0e9-4045d6687605",
"title": "August 9, 15:00",
"description": "Monday, August 9, 2021. 4:00PM"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"listAction": {
"button": "button text",
"sections": [
{
"title": "Section One",
"rows": [
{
"identifier": "9ab8d65e-d389-4123-b97b-702e658cc9e4",
"title": "August 7, 11:00",
"description": "Saturday, August 7, 2021. 11:00AM"
},
{
"identifier": "2051afef-e000-47d0-99a5-7d96c17968b2",
"title": "August 7, 15:00",
"description": "Saturday, August 7, 2021. 3:00PM"
},
{
"identifier": "55baac93-a513-45d0-ad9e-2e2271861fc8",
"title": "August 9, 11:00",
"description": "Monday, August 9, 2021. 11:00AM"
},
{
"identifier": "e2703f03-689c-4d1e-b0e9-4045d6687605",
"title": "August 9, 15:00",
"description": "Monday, August 9, 2021. 4:00PM"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"listAction": {
"button": "button text",
"sections": [
{
"title": "Section One",
"rows": [
{
"identifier": "9ab8d65e-d389-4123-b97b-702e658cc9e4",
"title": "August 7, 11:00",
"description": "Saturday, August 7, 2021. 11:00AM"
},
{
"identifier": "2051afef-e000-47d0-99a5-7d96c17968b2",
"title": "August 7, 15:00",
"description": "Saturday, August 7, 2021. 3:00PM"
},
{
"identifier": "55baac93-a513-45d0-ad9e-2e2271861fc8",
"title": "August 9, 11:00",
"description": "Monday, August 9, 2021. 11:00AM"
},
{
"identifier": "e2703f03-689c-4d1e-b0e9-4045d6687605",
"title": "August 9, 15:00",
"description": "Monday, August 9, 2021. 4:00PM"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "LIST",
"header": {
"text": "Sample text"
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"listAction": {
"button": "button text",
"sections": [
{
"title": "Section One",
"rows": [
{
"identifier": "9ab8d65e-d389-4123-b97b-702e658cc9e4",
"title": "August 7, 11:00",
"description": "Saturday, August 7, 2021. 11:00AM"
},
{
"identifier": "2051afef-e000-47d0-99a5-7d96c17968b2",
"title": "August 7, 15:00",
"description": "Saturday, August 7, 2021. 3:00PM"
},
{
"identifier": "55baac93-a513-45d0-ad9e-2e2271861fc8",
"title": "August 9, 11:00",
"description": "Monday, August 9, 2021. 11:00AM"
},
{
"identifier": "e2703f03-689c-4d1e-b0e9-4045d6687605",
"title": "August 9, 15:00",
"description": "Monday, August 9, 2021. 4:00PM"
}
]
}
]
},
"alternativeText": "Simple message text"
}
}
}
Section
title
Sim
Texto da seção exibido.
String
productItems
Sim
Matriz de pelo menos um item de produto. Máximo de 30 produtos em todas as seções.
ProductItem[]
Product Item
productRetailerId
Sim
A ID do produto configurada no Gerenciador de Negócios
String
ListAction
button
Sim
Conteúdo do botão para mensagem
String
sections
Sim
Matriz de seções. Deve haver pelo menos 1 seção
Section[]
Section
title
Sim
Título da seção que será exibido para o usuário. Máximo de 24 caracteres. Só é necessário se você tiver mais de uma seção
String
rows
Sim
Matriz de linhas. Deve haver pelo menos 1 linha e no máximo 10 linhas em todas as seções
Row[]
Row
identifier
Sim
Identificador exclusivo da linha
String
title
Sim
Conteúdo do título da linha
String
description
Não
Conteúdo da descrição da linha
String
ReplyButtonAction
buttons
Sim
Matriz de um, dois ou três botões
Button[]
Button
reply
Sim
Estrutura do botão
Reply
Reply
title
Sim
Texto do botão exibido. Máximo de 20 caracteres
String
payload
Sim
Informações extras que são retornadas no retorno de chamada (como já acontece para os botões Modelo). Máximo de 256 caracteres
String
Exemplo de solicitação de mensagem ReplyButton
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "REPLY_BUTTON",
"header": {
"text": "Sample text",
"image": {
"type": "JPG",
"url": "https://...jpg"
},
"video": {
"type": "MP4",
"url": "https://...mp4"
},
"document": {
"type": "PDF",
"url": "https://...pdf"
},
"location": {
"geoPoint": "-22.894180,-47.047960",
"name": "Wavy",
"address": "Av. Cel. Silva Telles"
}
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"replyButtonAction": {
"buttons": [
{
"reply": {
"title": "Display Text 1",
"payload": "callback_payload_1"
}
},
{
"reply": {
"title": "Display Text 2",
"payload": "callback_payload_2"
}
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "REPLY_BUTTON",
"header": {
"text": "Sample text",
"image": {
"type": "JPG",
"url": "https://...jpg"
},
"video": {
"type": "MP4",
"url": "https://...mp4"
},
"document": {
"type": "PDF",
"url": "https://...pdf"
},
"location": {
"geoPoint": "-22.894180,-47.047960",
"name": "Wavy",
"address": "Av. Cel. Silva Telles"
}
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"replyButtonAction": {
"buttons": [
{
"reply": {
"title": "Display Text 1",
"payload": "callback_payload_1"
}
},
{
"reply": {
"title": "Display Text 2",
"payload": "callback_payload_2"
}
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "REPLY_BUTTON",
"header": {
"text": "Sample text",
"image": {
"type": "JPG",
"url": "https://...jpg"
},
"video": {
"type": "MP4",
"url": "https://...mp4"
},
"document": {
"type": "PDF",
"url": "https://...pdf"
},
"location": {
"geoPoint": "-22.894180,-47.047960",
"name": "Wavy",
"address": "Av. Cel. Silva Telles"
}
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"replyButtonAction": {
"buttons": [
{
"reply": {
"title": "Display Text 1",
"payload": "callback_payload_1"
}
},
{
"reply": {
"title": "Display Text 2",
"payload": "callback_payload_2"
}
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "REPLY_BUTTON",
"header": {
"text": "Sample text",
"image": {
"type": "JPG",
"url": "https://...jpg"
},
"video": {
"type": "MP4",
"url": "https://...mp4"
},
"document": {
"type": "PDF",
"url": "https://...pdf"
},
"location": {
"geoPoint": "-22.894180,-47.047960",
"name": "Wavy",
"address": "Av. Cel. Silva Telles"
}
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"replyButtonAction": {
"buttons": [
{
"reply": {
"title": "Display Text 1",
"payload": "callback_payload_1"
}
},
{
"reply": {
"title": "Display Text 2",
"payload": "callback_payload_2"
}
}
]
},
"alternativeText": "Simple message text"
}
}
}
{
"destinations": [
{
"correlationId": "MyCorrelationId",
"destination": "5519900001111"
}
],
"message": {
"interactive": {
"messageInteractiveType": "REPLY_BUTTON",
"header": {
"text": "Sample text",
"image": {
"type": "JPG",
"url": "https://...jpg"
},
"video": {
"type": "MP4",
"url": "https://...mp4"
},
"document": {
"type": "PDF",
"url": "https://...pdf"
},
"location": {
"geoPoint": "-22.894180,-47.047960",
"name": "Wavy",
"address": "Av. Cel. Silva Telles"
}
},
"body": {
"text": "Main message text"
},
"footer": {
"text": "Footer text"
},
"replyButtonAction": {
"buttons": [
{
"reply": {
"title": "Display Text 1",
"payload": "callback_payload_1"
}
},
{
"reply": {
"title": "Display Text 2",
"payload": "callback_payload_2"
}
}
]
},
"alternativeText": "Simple message text"
}
}
}
Last updated
Was this helpful?