Authentication
To authenticate your Python requests, you will either need to generate an API token for your Nextspace account, or perform a login to get the session ID.
To authenticate your Python requests, you will either need to generate an API token for your Nextspace account, or perform a login to get the session ID.
import bruce_models as BM
# Perform a login through the Guardian API.
session = BM.Session.login(guardian, username="your-username", password="your-password", account_id="your-account-id")
# Get the SSID from your session.
ssid = session["ID"]
# Create your Bruce API instance, or set the session ID if you already have one.
bruce.set_session_id(ssid)import bruce_models as BM
# There is no comfortable way to provide the token directly yet.
# However, you can login with a token by excluding the username and then use the same method as before.
# Perform a login through the Guardian API.
session = BM.Session.login(guardian, username="", password="your-access-token", account_id="your-account-id")
# Get the SSID from your session.
ssid = session["ID"]
# Create your Bruce API instance, or set the session ID if you already have one.
bruce.set_session_id(ssid)