Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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

0 votes
Answer accepted

I've used wrong documentation and end point:

https://developer.atlassian.com/display/CONFDEV/Confluence+REST+API

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?

Did your issue ever get resolved @Robert Metcalf ? I'm having the same issue right now as well. The confluence server API always returns a list of pages I didn't request to GET when I try to POST a new page to a wiki.

Like 정예린 likes this

Make sure you are using HTTPS.  I was using HTTP by mistake and I believe the server was redirecting it to a GET request thus always returning response 200.

Like deniskutovskiy likes this

@Matt_Leicht Accidental using of HTTP was my issue. Thanks!

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

Announcing Team Calendars in Confluence Data Center

Hi Community! We're thrilled to share that Team Calendars for Confluence is now a built-in feature for Confluence Data Center releases 7.11 and beyond.  A long time favorite,  Team Cale...

82 views 0 3
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you