Webhooks FlowBuilder Nativo
Botão Copiar e Colar
JavaScript
let data = JSON.stringify({
"number": "{{number}}",
"customData": {
"body": "Olá {{name}}, utilize o botão abaixo para copiar e colar a chave pix para pagamento. Após a transferência, envie seu comprovante nesta mensagem.",
"name": "cta_copy",
"params": "{\"display_text\":\"Copiar Código PIX para Pagamento\",\"id\":\"4deb8c2f-7863-95eb-7b11-17a3f1931268\\",\\"copy_code\\":\\"11978097649\",\"disabled\":false}"
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.robomensageiro.com.br/api/messages/sendCopyPaste',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{connection_token}}'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Botão Call To Action
JavaScript
let data = JSON.stringify({
"number": "{{number}}",
"customData": {
"body": "Então {{name}}, me diz o que você achou?",
"name": "quick_reply",
"params": "{\"display_text\":\"LEGAL\",\"id\":\"aaa\",\"disabled\":false}",
"nameb": "quick_reply",
"paramsb": "{\"display_text\":\"NÃO GOSTEI\",\"id\":\"ccc\",\"disabled\":false}"
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.robomensageiro.com.br/api/messages/sendBTN2',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{connection_token}}'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});
Botão Legado (WEB)
JavaScript
let data = JSON.stringify({
"number": "{{number}}",
"customData": {
"body": "Aqui vem o Body",
"footer": "Rodapé",
"imageURL": "https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.png",
"title": "Título",
"caption": "Caption",
"buttons": "[{\"buttonId\":\"id1\",\"type\":2,\"buttonText\":{\"displayText\":\"Botao 1\"},\"nativeFlowInfo\":{\"name\":\"quick_reply\",\"paramsJson\":\"{\\\"display_text\\\":\\\"Botao 1\\\",\\\"id\\\":\\\"id1\\\",\\\"disabled\\\":false}\"}},{\"buttonId\":\"id2\",\"buttonText\":{\"displayText\":\"Botao 2\"},\"type\":1},{\"buttonId\":\"id3\",\"buttonText\":{\"displayText\":\"Botao 3\"},\"type\":1}]"
}
});
let config = {
method: 'post',
maxBodyLength: Infinity,
url: 'https://api.robomensageiro.com.br/api/messages/sendBTN',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer {{connection_token}}'
},
data : data
};
axios.request(config)
.then((response) => {
console.log(JSON.stringify(response.data));
})
.catch((error) => {
console.log(error);
});