Answered

Add ticket with attachment via API

Hi, i have some problem with adding ticket with attachment via API, i'm doing this with json, and adding ticket without attachment is working, but i don't know how to add ticket witch attachment in json via API

 

string json = $"{{\"helpdesk_ticket\":{{\"email\":\"{userEmail}\",\"subject\":\"{subject}\",\"description_html\":\"{fullDescription}\",\"name\":\"{name + ' ' + surname}\"}}}}";

 This is my json for ticket without attachment and i don't know how prepare json for ticket with attachment :/



Best Answer

Just checked with a developer, clear JSON format is not possible. You have to use a multipart/form-data request.


And my file is in array of bytes

Hello rudzik92,


We have an example that shows how to create a ticket with attachments - https://developers.freshdesk.com/api/#create_ticket_with_attachment


Could you give that a try and see if it works if you?

I saw this, but i want to use clear json format, not curl, it is possible?

Answer

Just checked with a developer, clear JSON format is not possible. You have to use a multipart/form-data request.

Can you give me some samples in c#? I found something like this https://gist.github.com/subwiz/dff5daccce97c57958ec but it is not working :/

 Any solution on that? I have the same issue please

Please use a new place for developers to seek help - https://community.developers.freshworks.com/

Login or Signup to post a comment