Skip to content

Instantly share code, notes, and snippets.

@tispratik
Created December 4, 2024 09:17
Show Gist options
  • Save tispratik/acf95d21034092700ae67bd1aa723e1a to your computer and use it in GitHub Desktop.
Save tispratik/acf95d21034092700ae67bd1aa723e1a to your computer and use it in GitHub Desktop.
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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment