Forums

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

Confluence REST API unable to create Child page

Pooja Shirlal September 5, 2017

Hi,

I am trying to create a Child page in Confluence using restAPI but getting a 403 error response.

Request:

{
"type":"page",
"title":"New child page",
"ancestors":[

{"id":206583541}

],
"space":{"key":"/rest/api/space/MySpace"},
"body":
{"storage":
{"value":"<p>This is a new child page</p>",
"representation":"storage"}
}
}

Respone:

{
"statusCode": 403,
"data": {
"authorized": false,
"valid": true,
"errors": [],
"successful": false
},
"message": "Could not create content with type page"
}

Note: I am able to run a GET and PUT (update the confluence pages) succesfully.

 

 

 

2 answers

1 accepted

0 votes
Answer accepted
Pooja Shirlal September 6, 2017

I was able to resolve the issue by fixing my request.

The space key had to be updated from:
"space": {
"key": "/rest/api/space/MySpace"
},

 

to 

"space": {
"key": "MySpace"
},

smitha
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 16, 2018

Hi Pooja,

How does PUT and GET working, can you please share an example?

0 votes
Pavel Potcheptsov
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 6, 2017

Do you really pass "/rest/api/space/MySpace" string as a space key?

Pooja Shirlal September 6, 2017

Hi Pavel,

Yes I do pass /rest/api/space/MySpace as space key.
Also, I am able to create the page manually in confluence, so I am guessing its not permission issue.

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, loom, loom for training, loom for teaching, video training, async learning, online education, screen recording, loom tutorials, loom use cases, atlassian learning, team training tools, instructional video, virtual training tools

🛗 Elevate Your Training and Enablement with Loom

Join us June 26, 11am PT for a webinar with Atlassian Champion Robert Hean & Loom’s Brittany Soinski. Hear tips, stories, and get your burning questions answered. Learn how Loom makes training and enablement easier. Don’t miss it!

Register today
AUG Leaders

Atlassian Community Events