How get phone field (deals) value into my function code?
Hi, i have extension that connect to whatsapp. Zapphub is extension.
my code is working, but phone number is fixed: "5521993449999@c.us"
I need get value that is inside field "whatsapp1" inside deals module
this way, i will run automation everytime that deal is created.
This value is filled in this format: "+5521993449999", so i need remove "+" and add @c.us
this way, value will transform from "+5521993449999" to "5521993449999@c.us"
- // Definir a URL da solicitação
- url = "https://api.zapphub.com/v1/chat/xxxxxxx/chats";
- // Definir os cabeçalhos da solicitação
- headers = map();
- headers.put("Content-Type", "application/json");
- headers.put("Token", "yyyyyyyyyyyyyy");
- // Definir o corpo da solicitação
- body = '{"action":"assign","chats":["5521993449999@c.us"],"params":{"agent":"zzzzzzzzzzzzzz"}}';
- // Realizar a solicitação HTTP
- response = invokeurl(url, "PATCH", body, headers);
- // Verificar e exibir a resposta
- if (response != null && response != "") {
- info response;
- } else {
- info "Erro: Resposta vazia";
- }