itgeek
itgeek

Reputation: 589

Access confluence page using Rest API Queries

how to authenticate to confluence page using python script. I need to login to confluence page using python script, and export a page to zip/csv.

Upvotes: 1

Views: 2199

Answers (2)

CraZ
CraZ

Reputation: 1834

If you don't mind and prefer a simplified Confluence REST API client in Python, you might want to give atlassian-python-api a chance. See examples.

Upvotes: 0

MaveDustaine
MaveDustaine

Reputation: 11

For authentication I used a simple GET request (using the requests library) to Confluence using the username and PW the user's provided.

if statuscode == 200 then success, anything else is likely a failure (although I believe 401 is specifically the authentication fail

It would be something like below:

import requests
urllogin = 'https://confluence.yourDomain.com/rest/api/content/'
login = requests.get(urllogin, auth=('username', 'password'))
if login.status_code == 200:
    print("Success")

Upvotes: 1

Related Questions