Hello everyone,
I am trying to create a child page through REST API, but I am always getting:
"message": "A page with this title already exists: A page already exists with the title new page2 in the space with key CM",
"reason": "Bad Request",
"statusCode": 400
This is the HTTP API POST that I am using:
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page","ancestors":[{"id":110198787}], "space":{"key":"CM"},"body":{"storage":{"value":"<p>This is a new page</p>","representation":"storage"}}}' http://localhost:8090/rest/api/content/ | python -mjson.tool
And my question what am I doint wrong?
The issue is with the id?
The id, is from the page where we want to create the child page or if I must add more fields to identify the page in question. My objective is to create a cascade of pages. For example Page C is a child of Page B, and Page B is a child of Page A who is in the root of Space 1.
Thanks in advance!
Not the id, the first line of the error message is almost certainly the problem - you already have a page with that title in that space.
Ah ok, I didnt notice previously that I cannot have a child page with the same name of the ancestor.
I made a test with other titles and was able to create child pages.
Thanks for the help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.