Freshworks named the only Challenger in 2021 Gartner® Magic Quadrant™ for ITSM tools. Access Report

Start a new topic

API Issues with ticket creation

 I've been working on a ticket creation script in perl.   I have had it partially working where it will create a very basic ticket.  However tonight when I've been working on it, it appears that  no matter what I do, I'm getting 500 server errors.   I've commented out all the additions I made and still get the 500 errors. 

I just tried a couple of calls using CURL with an example create ticket call, and even with that I'm getting a 500 server error.   Here is the call I used:-

curl -u <APIKEY>:test -H "Content-Type: application/json" "helpdesk_ticket": { "description": "Test Ticket", "subject": "Test Ticket - Ignore", "email": "", "priority": 1, "status": 2 }' -X POST -v

I removed personal/company information from the above example for security purposes.

* upload completely sent off: 146 out of 146 bytes
< HTTP/1.1 500 Internal Server Error
< Content-Type: text/html; charset=utf-8
< Date: Mon, 03 Apr 2017 03:49:18 GMT
< Status: 500 Internal Server Error
< X-Rack-Cache: invalidate, pass
< X-Request-Id: c8b5b6f4252c04880313a6095b69eb3e
< X-Runtime: 0.002764
< Content-Length: 38006
< Connection: keep-alive

1 Comment

Hi Hugh,

Please try the api mentioned below.

curl -u <API key>:X -H "Content-Type: application/json" -d '{ "helpdesk_ticket": { "description": "Details about the issue...", "subject": "Support Needed...", "email": "", "priority": 1, "status": 2 }, "cc_emails": "," }' -X POST https://<URL>

Here the difference is 

curl -u

curl -u apikey:X -H 

This is the difference when you use the username/password and the api key.

Hope this helps.



Freshservice support

Login or Signup to post a comment