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, atlassian community, job interviews, interview tips, career advice, interview preparation, job search, interview experiences, hiring process, atlassian careers, community discussion, interview best practices

Interview Tips & Pet Peeves ✍️

Join the discussion on interview best practices and common pitfalls. Share your experiences and learn from others in the Atlassian Community.

Share you experiences!
AUG Leaders

Atlassian Community Events