Enviar mensagens interativas
Last updated
Last updated
Para enviar mensagens usando recursos interativos, também seguiremos o formato JSON BASE. O objeto de mensagem deve ter um único campo:interactive
Campo | Necessário | Detalhes | Tipo |
---|---|---|---|
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"
}
}
}
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é
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"
}
}
}
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"
}
}
}
Field | Required | Details | Type |
---|---|---|---|
Field | Required | Details | Type |
---|---|---|---|