I want to integrate Confluence into my website.
I need the following two functionality:
1. User comes to my website and clicks Connect. The user grants authorization.
2. User search in our 'dedicated search section of confluence', they will start seeing the data(if they have authorized) .
Can anyone provide the documentation for getting Confluence KnowledgeBase Data through API?
Hello there! Hey Rahul, thanks for reaching out to Community.
You can use REST API to perform searches in Confluence. Here we have documentation on this here:
Since we need to authenticate to send the search request and get the response, you can find some very useful information in this other thread, here in the Community:
Let us know if this helps you out Rahul!
HI @Diego , thanks for the reply.
I am able to get Confluence content through rest API.
But, the content which is made global, is only accessible through the rest API.
How will I get data, if not global?
I want to emphasise, my website which I have mentioned here is non-Atlassian website, like - www.abcde****xyz.com.
Yes, most of this procedure will be done by REST API. Here is an example of search using REST API:
curl -u admin:admin -G "http://myinstance.address:8090/rest/api/content/search" --data-urlencode "cql=(type=page and space=low and title ~ "LOWERTOWN")" \ | python -m json.tool
The example above will search for a Confluence Page within the space with low as its key and that has the title set as LOWERTOWN.
The username:password is mandatory. You will need to get it from your users through a variable. This variable should be populated by the website user itself.
You can check here how to create more complex queries for Confluence:
Also, here we have some REST API examples:
With the result, we now need to look into _links and "webui". This shows us what is the address that Confluence looks into when accessing this page. In this current example, the full results are as follow:
By grabbing the "webui" link, we can recreate the full page link, which would be http://myinstance.address:8090/display/low/LOWERTOWN.
With this link, we can now try to show the page within an iFrame:
Confluence may ask for authentication at this point or straight up refuse to show the page. In this case, we will need to look into XRSF:
Hope this drives your objectives a little further Rahul! Let us know your results, looking forward to your reply.
Confluence Space Cleanup Play Complete our new Play with your team to declutter your shared workspace and power knowledge-sharing and collaboration. Download the PDF version of Play i...