Confluence REST API, Create new page does not work, update are working well

Hello,

 

I'm trying to use postman tool to create API call for creation of new confluence page.

I've also used python console too for that, but in any casese it's does not work.

 

POST /confluence/rest/api/content/ HTTP/1.1
Host: leverxeu.atlassian.net
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 986c9484-c4e6-87be-891c-6ba1b7e079dd

{
"title": "My new title",
"type": "page",
"space": {"key":"LXEMP02"},
"body":{
"storage":{
"value":"<p>New page data.</p>",
"representation":"storage"
}
}
}

 

System always return the same response if you will call the same endpoint with GET method. No errors no messages always code 200

 

Could somebody help me with that?

 

REST API for updating page are working well.

 

PUT /confluence/rest/api/content/91980485 HTTP/1.1
Host: leverxeu.atlassian.net
Authorization: Basic XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 911456d9-b5b1-1440-4686-7de6f51d492c

{"id":"91980485","type":"page",
"title":"new page","space":{"key":"LXEMP02"},"body":{"storage":{"value":
"<p>This is the updated text for the new page</p>","representation":"storage"}},
"version":{"number":2}}

 

 

1 answer

1 accepted

I have the same problem. I am sending a POST to http://wiki.xx.ac.uk/rest/api/content/

It dosen't matter if I give invalid JSON all I get back is a 200 OK and the results as if I ran a get.

I am able to update pages by sending a PUT to

http://wiki.xx.ac.uk/rest/api/content/913

The documentation you point to is the one I am using. Can you tell me which documentation you are using, which you were using and why there is a difference between the two?

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Kesha Thillainayagam
Posted Apr 13, 2018 in Confluence

We want to hear how your non-technical teams are using Confluence!

Hi Community! Kesha (kay-sha) from the Confluence marketing team here! Can you share stories with us on how your non-technical (think Marketing, Sales, HR, legal, etc.) teams are using Confluen...

1,702 views 25 10
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you