Skip to content

Instantly share code, notes, and snippets.

@tispratik
Created December 4, 2024 09:17
Show Gist options
  • Select an option

  • Save tispratik/acf95d21034092700ae67bd1aa723e1a to your computer and use it in GitHub Desktop.

Select an option

Save tispratik/acf95d21034092700ae67bd1aa723e1a to your computer and use it in GitHub Desktop.

Revisions

  1. tispratik created this gist Dec 4, 2024.
    47 changes: 47 additions & 0 deletions Deluge Push to Futwork
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,47 @@
    void automation.pushToFutwork(Int leadID, String leadPhone, String fName)
    {
    leadId = 274638000051159057;
    leadPhone = "+918970926449";
    fName = "Sujanadarshan";

    pushUrl = "https://dial.futwork.com/leads/push?teleproject=6749a6b643f75800138885cc";
    apiKey = zoho.crm.getOrgVariable("FutWork_API_Key");

    //Create Header
    headers = Map();
    headers.put("x-api-key", apiKey);
    // headers.put("content-type", "application/json");

    //Create Body
    leadBody = Map();
    leadData = Map();
    leadData.put("name", fName);
    leadBody.put("mobile", leadPhone);
    leadBody.put("data", leadData);

    leadBody2 = Map();
    leadData2 = Map();
    leadData2.put("name", "Pratik");
    leadBody2.put("mobile", "+918970926450");
    leadBody2.put("data", leadData2);

    params = List();
    params.add(leadBody);
    params.add(leadBody2);

    inputParams = Map();
    inputParams.put("raw-data", params);

    //Push to Futwork
    info params;

    resp = invokeUrl
    [
    url: pushUrl
    content-type: "application/json"
    type: POST
    parameters: params.toString()
    headers: headers
    ];
    info resp;
    }