Hello,
I'm using the REST API to create tickets from a custom tool, and it works fine.
Now I want to add some files (logs, configuratuon files, etc.) to the created tickets.
I tried using this query :
{ "refType": "Ticket", "refId": "1234", "description": "Fichiers du mobile", "fileName": "bupreport.zip", "file": "{Convert.ToBase64String(zip)}" }
It creates an attachment, but I can't see the file, it looks like it wasn't uploaded.
I'm not sure how I should provide the file contents.
I tried encoding the file in base64 in a field "file" but it looks like to be ignored.
I tried as a multipart request too, but it fails.
var content = new MultipartFormDataContent();
content.Add(new StringContent("Ticket"), "refType");
content.Add(new StringContent(ticket.Id.ToString()), "refId");
content.Add(new StringContent("BugReport"), "description");
content.Add(new StringContent("bupreport.zip"), "fileName");
content.Add(byteArrayContent, "data", "bugreport.zip");
How can I do ?
If it's impossible, how can I upload an attachment using a regular HTTP POST request like the browser uses when we send a file from the HTML GUI?
The API is not designed to upload files.