Forums

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

"1)create a new page as a child of another page" with!!!!! "2)upload an attachment".

sw5771.park
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!
June 7, 2023

hello.

I want to do "1)create a new page as a child of another page" with!!!!! "2)upload an attachment".


what is the additional option? -F "file=@myfile.txt" ???


1) Create a new page as a child of another page
https://developer.atlassian.com/cloud/confluence/rest-api-examples/#create-a-new-page-as-a-child-of-another-page

curl -u admin@example.com:api_token -X PUT -H 'Content-Type: application/json' -d'{"id":"3604482","type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}},"version":{"number":2}}' https://your-domain.atlassian.net/wiki/rest/api/content/3604482 | python -mjson.tool

 

2) Upload an attachment
https://developer.atlassian.com/cloud/confluence/rest-api-examples/#upload-an-attachment

curl -v -S -u admin@example.com:api_token -X POST -H "X-Atlassian-Token: no-check" -F "file=@myfile.txt" -F "comment=this is my file" "https://your-domain.atlassian.net/wiki/rest/api/content/3604482/child/attachment" | python -mjson.tool

 

1) + 2)
curl -u admin@example.com:api_token -X PUT -H 'Content-Type: application/json' -d'{"id":"3604482","type":"page","title":"new page","space":{"key":"TST"},"body":{"storage":{"value":"<p>This is the updated text for the new page</p>","representation":"storage"}} -F "file=@myfile.txt" ,"version":{"number":2}}' https://your-domain.atlassian.net/wiki/rest/api/content/3604482 | python -mjson.tool
=== > is this right? or wrong?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events