I need working example of creating new wiki page in confluence using rest api. I prefer the new page to be created under specific space and specific page. I read their api documentation and looked at few examples they had and still coming short.
Here is an example they had on their site
curl -u admin:admin -X POST -H 'Content-Type: application/json' -d'{"type":"page","title":"new page","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
I tried above with my space name, new title and changed the url to mysite/rest/api/content and returned content was basically html page saying the page does not exist or the page exists but you do not have permission. I have confirmed that I have access to confluence wiki and can create new wiki using my credentials.
What is also not clear is in the example above how is it calling the specific api that creates the page? It does not make sense.
similar question was asked on their forum, but no reasonable answer https://answers.atlassian.com/questions/149561/simple-confluence-rest-api-usage-what-am-i-missing
(I guess my end goal is to be able to create new wiki page on confluence automatically) I am okay to give up on confluence REST API to other solution if necessary.