Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,300,977
Community Members
 
Community Events
165
Community Groups

cannot authenticate with token or HTTPbasicauth

Roberto I'm New Here Mar 30, 2022

i can only cql anonymous pages. i am using the python3 requests module.

import requests
import json
from requests.auth import HTTPBasicAuth

auth = HTTPBasicAuth("username","password")
url = "https://confluenceurl/confluence/rest/api/content/search"
headers = {"Content-type": "application/json"}
data='cql=(space.title ~ "anythinghere")

response = requests.request("GET",url,headers=headers,auth=auth, params=data, verify=False)

print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))

 i also tried adding the token in the headers:

'Authorization': 'Basic base64loginhere '

{'results': [], 'start': 0, 'limit': 25, 'size': 0, 'cqlQuery': '(space.title ~ "whatimlookingfor")', 'searchDuration': 56, 'totalSize': 0.....

 

any help is appreciated.

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Confluence

An update on Confluence Cloud customer feedback – June 2022

Hi everyone, We’re always looking at how to improve Confluence and customer feedback plays an important role in making sure we're investing in the areas that will bring the most value to the most c...

402 views 2 13
Read article

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