Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Attach a ZIP file to an issue with path in the body request

Emma Lanctuit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 8, 2021

I would like to use the Rest API to do so :

curl -D- -u {username}:{password} -X POST -H "X-Atlassian-Token: nocheck" -F "file=@{path/to/file}" http://{base-url}/rest/api/2/issue/{issue-key}/attachments

However I can only add headers and body in my POST request. 
How can I do so? I received an 415 error with a body : file=@zipfilepath
and in the headers :
X-Atlassian-Token: no-check
Authorization: Basic credentials
Accept: application/json
Content-Type: application/x-www-form-urlencoded

Can someone help?

1 answer

0 votes
Emma Lanctuit
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 9, 2021

Capture.PNG
If this can help... the path is an http://filepath.zip

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events