How get created deal URL into my function automation code?
Hi, i have extension that connect to whatsapp. Zapphub is extension. I have code to assign metadata to chat.
my code is working, but metadata is getting fixed url fixed:"https://crm.zoho.com/crm/org000000000/tab/Potentials/6144369000004050000"
i want to get url of created deal automatically, so, instead set url fixed in code, i want to create rule, when i create new deal, in functions generate this url that will open created deal on browser.
See actual code
- // Definir o número de telefone em uma variável
- telefone = "5521995819999";
- // Definir a URL da solicitação usando o número de telefone da variável
- url = "https://api.zapphub.com/v1/chat/xxxxxxxxxxx/contacts/" + telefone + "@c.us/metadata";
- // Definir os cabeçalhos da solicitação
- headers = map();
- headers.put("Content-Type", "application/json");
- headers.put("Token", "yyyyyyyyyy");
- // Definir o corpo da solicitação
- body = '[{"key":"CRM","value":"https://crm.zoho.com/crm/org000000000/tab/Potentials/6144369000004050000"}]';
- // 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";
}