Let us consider an example in which a new task is created in Zoho Connect whenever a ticket is added in Zoho Desk. This is implemented using an Outgoing Webhook in Zoho Desk that will make a POST request to an API endpoint in Zoho Connect. But Desk's
call back request structure doesn't match the requirements of the Zoho Connect's
create task API and hence it is not possible to share the data as it is. So, a Function API is used to customize the structure of the incoming request to meet Zoho Connect's requirements.
Step 1: Create a Function API configuration
- Click the gear icon [
] in the right menu.
- Select Settings from the dropdown.

- In the Settings page, click Function API under Developer Space.

- In the new page, click Create Configuration.

- In the configuration details page, give a name, icon, and description.
- Click Save & edit code.

Step 2: Since the POST request is made from Zoho Desk, write the code mentioned below in the post request handler.
- payloadArray = list(body);
- ticket = payloadArray.get(0);
- ticketPayload = ticket.get("payload");
- desc = ticketPayload.get("description");
- subject = ticketPayload.get("subject");
- response = invokeurl
- [
- url: "https://connect.zoho.com/pulse/api/addTask"
- type: POST
- parameters: {"scopeID":12266000000002002,"boardId":12266000000016001,"title":subject,"desc":desc,"sectionId":1226600000031376,"position":1}
- connection:"zohoconnect"
- ];
- info response;
- return {"statusCode":"201","response":"Task Created Successfully"};
Step 3: Generate the API endpoint URL in Zoho Connect.
- Click Expand found next to API endpoint.
- Click Generate URL.

Step 4: Configure the outgoing webhook in Zoho Desk with the generated URL from Zoho Connect network as the call back URL.
Now, whenever a ticket is added in Zoho Desk, a new task is created in Zoho Connect. Similarly, a configuration to update and delete tasks can also be done.
If you have any questions regarding Function API, please write to us at
support@zohoconnect.com. We'll be happy to help!