Attach Files to an Issue as base64Content

It is possible to add to API an optional way to send attachments as a base64Content in the body? 

e.g
URL: https:
//example.youtrack.cloud/api/issues/2-6/attachments?fields=id,name

Request body:
{
    "name": "file_name.txt",
    "base64Content": "data:base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38"
}

I can't use -F upload because the HTTP request implementation that I must use doesn't implement it.

0
1 comment
Official comment

Hi Tomasz,

thank you for your question.

At the moment, it's not possible to add attachments via REST API using base64Content. The only way to add attachments currently is described in this tutorial: https://www.jetbrains.com/help/youtrack/devportal/api-usecase-attach-files.html However, please note that the described method also implies using the -F option with curl.

We also have a feature request to add the option for using base64 for uploading attachments, but it's still in our backlog. Please feel free to vote, comment, and subscribe: https://youtrack.jetbrains.com/issue/JT-71009/Add-possibility-to-add-attachments-via-REST-API-using-bse64Content

Let us know if you have any questions, we'll be happy to answer.

Please sign in to leave a comment.