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

Confluence API return 302 Found

Jagmandeep Kaur September 24, 2019

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

 

<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https://*company domain*/confluence/rest/api/content/">here</a>.</p>
</body></html>

 

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
DPKJ
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 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
TAGS
AUG Leaders

Atlassian Community Events