Create a ticket with an asset by API

  • 31 January 2017
  • 10 replies


I am trying to use API to create a ticket, it is working fine
without assets, but when I add an asset, it gives me an error message
"We're sorry, but something went wrong. We've been notified about this
issue and we 'll take a look at it shortly".

The request :
"description":"Some details on the issue ...",
"subject":"Support needed..",
"priority":1, "status":2, "source":2,"ticket_type":"Incident",


(I already have an asset with ID=12 )

Can you advise?



This topic has been closed for comments

10 replies

Hi Waseem

Could you please try the below method and let me know if that works?

curl -u -H "Content-Type: application/json" -d '{ "helpdesk_ticket": { "description": "Details about the issue...", "subject": "Support Needed...", "email": "", "priority": 1, "status": 2 }, "associate_ci":{"serial_no":"ABC12345","name":"my printer","user":""} }' -X POST



Dear Rada,

I suppose that method will create a ticket and an asset "My printer", then assign that asset to the ticket.
I have tried it, it creates a ticket successfully without errors, but it does't create the asset "my printer".
However, I need to assign an existed asset to the ticket.


Hi Waseem

The code will not create an asset. It will create a ticket and link an existing asset that exist in your inventory.

In the above code, please mention the existing asset's serial number, name and used by details.

Will be glad to get on a call and help.



Thank you for your help, it is working fine now :)


Thanks for the confirmation Waseem.

Please let me know for any further queries or assistance. Will be glad to help.

Have a great time ahead !

Thanks & Regards


I am getting same error message. How this was resolved please?

Userlevel 3
Badge +4

Hello Avni,

Could you please help me with the error message that you're getting while running this command? Also let me know the command that you're trying so that we can analyse further?




I tried creating a ticket in FreshService referring to the below link and created a ticket in FreshService successfully.

Now, I need to create a ticket with an associated Asset. I referred to the solution @Radhahad mentioned. But the ticket is not getting created, and I am getting the below response:

Response Status : 302

Response Body :

<html><body>You are being <a href="">redirected</a>.</body></html>

Could anyone please help me creating a ticket with Asset using Java API.

Thanks & Regards,


Userlevel 1

Hi Amutha,

You can construct a script to include payload like below,

{ "helpdesk_ticket": { "description": "Details about the issue...", "subject": "Support Needed...", "email": "", "priority": 1, "status": 2 }, "associate_ci":{"serial_no":"C1MN8BGUDTY3"} }

The serial number is a mandatory field to associate a CI to a Ticket. Also, currently we only support default CI type Hardware to be associated with a Ticket. So, please verify if your code supports the same.

If still you are encountering issues around this please raise a support ticket and we are happy to assist with it.

Hi Thushan,

I raised a support ticket for the same and the issue is resolved. Since I am using v2.0 APIs, I used the below script to associate an asset with a ticket:

{"ticket":{"description":"Testing from Java ...","subject":"JAVA Support needed..","email":"","priority":4,"status":2,"type":"Incident","associate_ci":{"name":"Era Desktop"}}}

Thanks for your time.