Hi,
I'm trying to connect to confluence rest api using Python requests module. the request returned a 200 status ok but shows empty results `
import requests
url = "https://confluence.sp.vodafone.com/confluence/rest/api/content/search?cql=spaceKey='BDPL'&text~'BIF'&type=page&title='Neuron-BIF Documentation'"
payload = {}
headers = {
'Accept': 'application/json',
'X-Atlassian-Token': 'no-check',
'Authorization': 'Bearer XXXXXXXXXXXXXXXXXXXXXXX',
'Cookie': 'JSESSIONID=61ADDC1D0BE92FD3E276024CD6A8044A'
}
response = requests.request("GET", url, headers=headers, data=payload)
print(response.text)
Also a little more look into the permission from the request output json shows `
Hello @ShahajaKalivarapu
A 200 code means that the request was successful. The response from the API was just stating a fact... it couldn't find anything that matched your CQL
This is because your CQL contains many mistakes:
All of this is described on the Confluence Server CQL documentation pages.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
what worked for me is the response from this thread -https://community.atlassian.com/t5/Confluence-questions/Does-the-Confluence-REST-documentation-work/qaq-p/1654183
My organisation Confluence is installed at root, so I had to remove /confluence from the path.
The final working URL in my case was - https://<org confluence domain name>/rest/api/content/search?cql={cql}. This URL returned a response as described here in Confluence Rest api documnetation (https://developer.atlassian.com/cloud/confluence/rest/v1/api-group-search/#api-wiki-rest-api-search-get).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.