Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×I have tried to create a child page with an ancestor page id using confluence rest api, in C#.
I have tried to post json data with auth header as well but still the response from the API is not authorized.
While with the same credentials, I am able to create a child page manually, so this definitely might not be authentication issue.
Any help would be highly appreciated.
Hi, Abhijit.
Based on our documentation, the REST call to create a child page would be as the example below:
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d '{"type":"page","title":"new page", "ancestors":[{"id":456}], "space":{"key":"TST"},"body":{"storage":{"value": "<p>This is a new page</p>","representation":"storage"}}}' http://localhost:8080/confluence/rest/api/content/ | python -mjson.tool
* https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/
Based on your description it seems that you're trying to create it through C#, so I believe it would be a good idea to try the mentioned rest call through your terminal or even through an external REST API client (like postman) and check if you are able to create this page before trying in your C# code.
If it works using an external client, please share your C# code with the API call so we can have a better idea of what you're trying there.
Best,
Mallmann
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.