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 API return 302 Found

I am using confluence api curl command to create a new page on the confluence. But i am only gettting following respond.


<title>302 Found</title>
<p>The document has moved <a href="https://*company domain*/confluence/rest/api/content/">here</a>.</p>


Curl command :

curl -o out.json -u username:Password -X POST -H 'Content-Type:application/json' -H 'Accept:application/json' -d '{"type":"page","title":"new page","ancestors":[{"id":9567}],"space":{"key":" Database "},"body":{"storage":{"value":"<p>This is <br/> a new page</p>","representation":"view"}}}' --url "http://*company domain*/confluence/rest/api/content/" | python -mjson.tool


Also, one more thing though i am sending an http request in the response i am getting https url. 

1 answer

0 votes
DPK_J Community Leader Sep 24, 2019

@Jagmandeep Kaurtwo points,

  1. If your site is using HTTPS, don't use HTTP for request.
  2. If you are getting response code '302' you need to follow to redirected page, use '-L' flag with curl for this.

Something like,

curl -L  //your rest of code

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Confluence

How is your team having fun and bonding, remotely, utilizing Confluence?

Thanks everyone for answering last week’s question. The winner of the random drawing from those who commented is: @LarryBrock I’ll contact you separately with your prize details. This wee...

314 views 9 7
Join discussion

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