Request Token URL | |
Access Token URL | |
Refresh Token URL | |
Revoke Token URL | |
Scopes | Desk.tickets.READ,Desk.basic.READ,Desk.contacts.READ,Desk.events.ALL,Desk.settings.READ,Desk.search.READ,Desk.tickets.READ |
Connector API Name | Method type | URL |
Get tickets by contact | GET | https://desk.zoho.com/api/v1/contacts/${contactid}/tickets |
Search Contacts | GET | https://desk.zoho.com/api/v1/contacts/search?limit=1&email=${email} |
//Retrieving the record details and storing the email value response = zoho.crm.getRecordById("Contacts",contact.get("Contacts.ID").toLong()); Email = response.get("Email"); orgid = zoho.crm.getOrgVariable("xxx__Orgid"); dynamic_map = Map(); dynamic_map.put("email",Email); dynamic_map.put("orgid",orgid); /*Invoking the search desk contacts api by passing the email id value retrieved from the get records*/ resp = zoho.crm.invokeConnector("xxx.desk.searchcontacts",dynamic_map); responsedata = resp.get("response"); data = responsedata.get("data"); //Fetching the id of the desk contact for each value in data { id = value.get("id"); } dynamic_map = Map(); orgid = zoho.crm.getOrgVariable("xxx__Orgid"); dynamic_map.put("contactid",id); dynamic_map.put("orgid",orgid); //Invoking the get tickets by contacts api by passing the contact id value retrieved resp1 = zoho.crm.invokeConnector("xxx.desk.getticketsbycontact",dynamic_map); responsedata1 = resp1.get("response"); data1 = responsedata1.get("data"); resp = ""; count = 1; //constructing the record for related list recordsXmlStr = "<record>"; for each value in data1 { recordsXmlStr = recordsXmlStr + "<row no='" + count + "'>"; weburl = value.get("webUrl"); ticketNumber = value.get("ticketNumber"); recordsXmlStr = recordsXmlStr + "<FL val='Associated ticket list' link=\"true\" url='" + weburl + "'>" + value.get("subject") + "- #" + ticketNumber + "</FL>"; recordsXmlStr = recordsXmlStr + "<FL val='Status'>" + value.get("status") + "</FL>"; recordsXmlStr = recordsXmlStr + "</row>"; count = count + 1; } recordsXmlStr = recordsXmlStr + "</record>"; resp = resp + recordsXmlStr; return resp; |
Writer is a powerful online word processor, designed for collaborative work.