Create Zoho Desk Ticket Using Deluge With 3 Different Methods

Here is the API Documentation link for the Zoho Desk. Zoho Desk API Documentation

First of all, to create a Zoho Desk Ticket there are some required parameters are there.

  1. subject
  2. departmentId
  3. contactId
  4. orgId

Here is the description of how you will get these values from your Zoho Desk.

Subject: You can add any custom text for the subject.

departmentId: Id of the department.

Go To Settings > General > Departments > Select the department in which you are going to work > you can see the departmentId in URL

contactId: ID of the Contact who created the ticket.

orgId: Id of the Organization

Code Example 1 :

Using inbuilt function and syntax.

<variable>=zoho.desk.create(<orgId>, <module_name>, <record_value>);

recordValue = {"subject" : "Create ticket", "departmentId":"686********07","contactId":"686**********01"};
response = zoho.desk.create(7*****61, "tickets", recordValue);
info response;

Code Example 2 :

Using Invoke URL. 

How To Generate Access Token And Refresh Token For Server Based Application In Zoho Using Postman

Get Access Token With The Use Of Refresh Token Using Zoho Deluge

token = invokeurl
[
  url :"https://accounts.zoho.com/oauth/v2/token?refresh_token=1000.****************asdasa&client_id=1000.***********4WQ2P6Y8XUO&client_secret=************90a7d181647&grant_type=refresh_token"
  type :POST
];
zoho_token = token.get('access_token');

header_desk = Map();

header_desk.put("authorization","Zoho-oauthtoken " + zoho_token);
header_desk.put("content-type","application/x-www-form-urlencoded");
header_desk.put("orgId","7*****61");

parameter_desk = Map();
parameter_desk.put("subject","Create tickets");
parameter_desk.put("departmentId","686537*******6907");
parameter_desk.put("contactId","6865*********94001");
get_ticket_response = invokeurl
[
  url : "https://desk.zoho.com/api/v1/tickets"
  type : POST
  headers : header_desk
  parameters:parameter_desk.toString()

];
info get_ticket_response;

Code Example 3 :

Using connection parameter.

Here is the documentation link of Zoho where you can refer how to create connection in Zoho Desk.

Zoho Desk Connection Documentation

parameter_desk = Map();
parameter_desk.put("subject","Creating Test ticket");
parameter_desk.put("departmentId","686537*******6907");
parameter_desk.put("contactId","6865*********94001");
get_ticket_response = invokeurl
[
  url :"https://desk.zoho.com/api/v1/tickets"
  type :POST
  parameters:parameter_desk.toString()
  connection:"56d09141-006a-*****************************"
];
info get_ticket_response; 

As per these 3 types you can create Zoho Desk Ticket using function of Zoho Desk, Invoke URL using Token, Invoke URL using Connection setup.

If this documentation helps kindly share your valuable feedback.

Thank You.

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe

Select Categories