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

cannot authenticate with token or HTTPbasicauth

Roberto March 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
AUG Leaders

Atlassian Community Events