Forums

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

How to upload a txt/img file through POSTMAN POST Call?

Lions ignitz
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!
September 15, 2021

How to upload a txt/img file through POSTMAN POST Call

2 answers

0 votes
Kishan Sharma
Community Champion
September 16, 2021

Hi @Lions ignitz Welcome to the Atlassian Community!

You can add attachment to a confluence page by sending a POST request to the /rest/api/content/<pageID>/child/attachment API endpoint.

Example Curl Command -

curl -u $USER_NAME:$USER_PASSWORD -X POST -H "X-Atlassian-Token: nocheck" -F "file=@${ATTACHMENT_FILE_NAME}" -F "comment=File attached via REST API" ${CONFLUENCE_BASE_URL}/rest/api/content/${PAGE_ID}/child/attachment

Please change USER_NAME/USER_PASSWORD/ATTACHMENT_FILE_NAME/CONFLUENCE_BASE_URL/PAGE_ID as necessary in the above command.

0 votes
Hana Kučerová
Community Champion
September 15, 2021

Hi @Lions ignitz ,

welcome to the Atlassian Community!

Would you please provide us with more information, what you are trying to achieve? Add one or more attachments to an existing Confluence content?

Thank you!

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events