Request Token URL | |
Access Token URL | |
Refresh Token URL | |
Scopes | ZohoAssist.sessionapi.CREATE |
Connector API Name | Method type | URL |
Create Session | POST |
Util={}; var EntityId; var EntityName; var temp; var emailid; var message; //Subscribe to the EmbeddedApp onPageLoad event before initializing the widget ZOHO.embeddedApp.on("PageLoad",function(data) { EntityId=data.EntityId[0]; console.log(EntityId); entityname=data.Entity; //Fetching the current record details and retrieving the necessary field information ZOHO.CRM.API.getRecord({Entity:entityname,RecordID:EntityId}) .then(function(data){ dataa=data.data[0]; email=dataa.Email; customeremail=encodeURIComponent(email); casestatus=dataa.Status; var x = { "customeremailid":customeremail, } /*Invoking the connector API to create a remote session with the customer in Zoho Assist by passing the constructed data set*/ ZOHO.CRM.CONNECTOR.invokeAPI("xxx.zohoassist.createsession",x) .then(function(dataa){ response=dataa.response; parseresponse=JSON.parse(response); representation=parseresponse.representation; //Fetching the necessary details from the created session response sessionid=representation.session_id; customerurl = representation.customer_url; technicianurl = representation.technician_url; document.getElementById("customeremail").value=email; document.getElementById("myAnchor").href = technicianurl; //Constructing and passing the fetched data to be inserted in the new custom module called Session Details var recordData = { "Name": "Remote Session - " + sessionid, "testsupport__Session_ID": sessionid, "testsupport__Case_Number":EntityId, "testsupport__Case_status_during_the_session_initiation":casestatus, } //Invoking the insert record API to insert a new record of the created session details ZOHO.CRM.API.insertRecord({Entity:"xxx__Session_Details",APIData:recordData,Trigger:[]}).then(function(data){ console.log(data); }); ZOHO.embeddedApp.init(); }) }) }) |
Writer is a powerful online word processor, designed for collaborative work.