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 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
AUG Leaders

Atlassian Community Events