The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Confluence Cloud REST API not working. Trying to make a "new page" on my home page.

Lee Ainscough
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!
August 8, 2023

Using the following with address and PAK changed

PAK works

curl -u 'lee_@blarblar.com:ATA_PAK_blar_blar' -X POST -H 'Content-Type: application/json' --data '{"type":"page","title":"FPGA Tree","space":{"key":"TREE"},"ancestors": [ {"id": "1962_some_existing_page678on_home_page" }],"body":{"storage":{"value":"<p>This is <br/> a new page</p>"}}}' --url 'https://blarblar.atlassian.net/wiki/rest/api/content'

 

This is as close to the non cloud, new page as a child of another examples. https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/

 

I get the following error.

Getting some sort of Authorization failure? But my PAK is working as the access time go's up when I use it. Error reported.

* Connection #0 to host blarblar.atlassian.net left intact

{"statusCode":403,"data":{"authorized":false,"valid":true,"errors":[],"successful":false},"message":"com.atlassian.confluence.api.service.exceptions.PermissionException: Could not create content with type page"}

Think this means I'm not specifying my page correctly?

Docs say you just add an "ancestors": [ {"id": "12345_page number" }] to the page of interest.

 

Any help would be appreciated to get the basics working please.

thanks

Lee

 

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Answer accepted
Marc -Devoteam-
Community Champion
August 9, 2023

Hi @Lee Ainscough 

The reference you use for examples is for Confluence Server/DC, not cloud.

Cloud can be found here: https://developer.atlassian.com/cloud/confluence/rest/v2/api-group-page/#api-pages-post 

There error refers to the type page you want to create, this option does not exist in the cloud api anymore.

This is a deprecated option.

The link I added is the rest API v2.

I hope this helps you.

Lee Ainscough
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!
August 9, 2023

Thankyou very much, appreciated

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events