Confluence REST API unable to create Child page

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

This widget could not be displayed.

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

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.

This widget could not be displayed.

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"
},

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Monday in Confluence

Why start from scratch? Introducing four new templates for Confluence Cloud

Hi my Community friends!  For those who don't know me, I'm a product marketer on the Confluence Cloud team - nice to meet you! For those of you who do, you know that I've been all up in your Co...

477 views 6 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you