I am trying to create a ticket with an attachment and am having an issue with the attachment segment. The return I am getting is 400: Bad Request. The file does exist already at the time of sending the request.
Everything works fine until I add the attachments segment. The documentation only shows a curl example. Does anyone know how the properties are for the attachments segment if using JSON?
To continue with what Anish is saying.
The attachment needs to be a file stream as part form-data of the request
Looking at your JSON - it’s not the JSON for a create ticket request. You have it wrapped with the key of 'ticket'. So I don’t know if you are sending this to a language-specific library.
For better help try to give us all the information. What language or tool (curl,postman,…) . Show us some simple sample code that demonstrates the issue.
As Anish says - start with the ‘curl’ command and go from there.
Curl will show you the headers and form data as well.