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
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.