I am using https://docs.atlassian.com/ConfluenceServer/rest/6.8.0/ documentation for Creating a Space and writing the content into it. But i am facing authentication issue. If i put GET API in browser and login into confluence then Getting correct Response.
But Same thing is not achieving by sending request from Postman/CURL. It is always returning 403 in response. because the documentation don't have an API for authentication. How i can achieve this?
Kindly have a look at the KB below:
https://developer.atlassian.com/cloud/confluence/basic-auth-for-rest-apis/
It is written there how to provide values for basic authenticaion.
Hi Alex,
Thanks for quick response. I am using my local confluence which is deploy on our local server. how i can generate token for confluence?
If you execute by curl then it must be like this
curl -D- \ -X GET \ -H "Authorization: Basic dXNlcjp1c2Vy" \ -H "Content-Type: application/json" \ "https://your-domain.atlassian.net/rest/api/2/issue/QA-31"
The Authorization part you do like this:
Authorization
Basic
user:userpassword
dXNlcjp1c2Vy
Hi Alex,With reference to this document https://developer.atlassian.com/server/confluence/confluence-rest-api-examples/curl -u myuser:mypwd -X GET "http://localip/confluence/rest/api/content?type=blogpost&start=0&limit=10&expand=space,history,body.view,metadata.labels"
this is return very basic response below
{"results":[],"start":0,"limit":10,"size":0,"_links":{"self":"http://myip/confluence/rest/api/content?expand=space,history,body.view,metadata.labels&type=blogpost","base":"http://myip/confluence","context":"/confluence"}}
Now same API request i am sending using browser
http://localip/confluence/rest/api/content?type=blogpost&start=0&limit=10&expand=space,history,body.view,metadata.labels
this is returning detailed response of content because i am logged in confluence.
What is the issue in my CURL?
It looks like you're new here. Sign in or register to get started.