Enviar uma Lista


Boa noite,


Estou precisando usar a lista no messenger e estou seguindo a documentação (Blip Portal) ao tentar usar o respectivo json trocando o valor do “id” e “to” no meu bot a msg não retorna. Estou utilizado o SDK javascript.


Segue o Json


{
"id": Lime.Guid(),
"to": destinatario,
"type":"application/vnd.lime.list+json",
"content":{
"header":{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Classic T-Shirt Collection",
"text":"See all our colors",
"previewUri":"https://peterssendreceiveapp.ngrok.io/img/collection.png",
"uri":"https://peterssendreceiveapp.ngrok.io/shop_collection?messengerExtensions=true",
"target":"selfTall"
}
},
"items":[
{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Classic White T-Shirt",
"text":"100% Cotton, 200% Comfortable",
"previewUri":"https://peterssendreceiveapp.ngrok.io/img/white-t-shirt.png",
"uri":"https://peterssendreceiveapp.ngrok.io/view?item=100&messengerExtensions=true",
"target":"selfTall"
}
},
{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Classic Blue T-Shirt",
"text":"100% Cotton, 200% Comfortable",
"previewUri":"https://peterssendreceiveapp.ngrok.io/img/blue-t-shirt.png",
"uri":"https://peterssendreceiveapp.ngrok.io/view?item=101&messengerExtensions=true",
"target":"selfTall"
}
},
{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Classic Black T-Shirt",
"text":"100% Cotton, 200% Comfortable",
"previewUri":"https://peterssendreceiveapp.ngrok.io/img/black-t-shirt.png",
"uri":"https://peterssendreceiveapp.ngrok.io/view?item=102&messengerExtensions=true",
"target":"selfTall"
}
}
]
}

2 comentários


Olá EEller, tudo bem ?


O problema está na query string de cada um dos links do exemplo.

Para utilizar links com o parâmetro: messengerExtensions=true, é necessário, inicialmente, liberar o domínio do link no Facebook como um domínio válido.


Utilize o exemplo abaixo para fazer seu teste:


{
"id": "1",
"to": "[email protected]",
"type":"application/vnd.lime.list+json",
"content":{
"header":{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Bots powered by BLiP",
"text":"See some bots powered by BLiP",
"previewUri":"https://blip.ai/wp-content/themes/blipai/assets/img-pack/brand_36dp.png",
"uri":"https://blip.ai",
"target":"selfTall"
}
},
"items":[
{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Santander",
"text":"Bot oficial do Santander Brasil",
"previewUri":"http://www.rgconsultoriaempresarial.com.br/site/wp-content/uploads/2014/07/SANTANDER.png",
"uri":"https://santander.com.br",
"target":"selfTall"
}
},
{
"type":"application/vnd.lime.web-link+json",
"value":{
"title":"Localiza",
"text":"Bot oficial da Localiza",
"previewUri":"https://pbs.twimg.com/profile_images/491237647478571008/r12mcMNR.png",
"uri":"https://www.localiza.com/",
"target":"selfTall"
}
}
]
}
};

Note que a única diferença está nas URLs dos links.


Obs.: Já atualizei o JSON de exemplo na documentação do BLiP (Blip Portal).


Muito obrigado pelo seu feedback.

Se precisar de qualquer coisa nos avise 😉

Obrigado Rafael, consegui agora com esse Json utilizar a Lista.


Obrigado pela ajuda. Abraços.

Comente