How get created deal URL into my function automation code?

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
  1. // Definir o número de telefone em uma variável
  2. telefone = "5521995819999";

  3. // Definir a URL da solicitação usando o número de telefone da variável
  4. url = "https://api.zapphub.com/v1/chat/xxxxxxxxxxx/contacts/" + telefone + "@c.us/metadata";

  5. // Definir os cabeçalhos da solicitação
  6. headers = map();
  7. headers.put("Content-Type", "application/json");
  8. headers.put("Token", "yyyyyyyyyy");

  9. // Definir o corpo da solicitação
  10. body = '[{"key":"CRM","value":"https://crm.zoho.com/crm/org000000000/tab/Potentials/6144369000004050000"}]';

  11. // Realizar a solicitação HTTP
  12. response = invokeurl(url, "PATCH", body, headers);

  13. // Verificar e exibir a resposta
  14. if (response != null && response != "") {
  15.     info response;
  16. } else {
  17.     info "Erro: Resposta vazia";
}