How do I include my apikey and username when I am using Confluence API?
Here's my code:
import requests
import json
url = "https://example.atlassian.net/wiki/rest/api/audit"
headers = {
"Accept": "application/json"
}
response = requests.request(
"GET",
url,
headers=headers
)
print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": ")))
Where would I add the authentication?
Thanks!
Hi @Vincent Stevenson ,
Welcome to the Atlassian Community.
This question has already been asked many times and by searching the community you can find threads having examples showing how to do so like, for example, the below one:
Please review above thread and let us know if it helps.
Cheers,
Dario
Hi Dario, the thread you are referencing is about Jira. Do you know if there is a similar solution to use with Confluence?
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Emilio Sebastian Carranza ,
Please notice that basic authentication with Atlassian Account (email address) and API Token works exactly the same way in Jira Cloud and Confluence Cloud. Therefore, the already provided example works for both.
For details:
Ciao,
Dario
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, I got it now.
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.