API Documentation¶
We are trying to provide useful APIs to help federations and service providers to integrate better. We also try to be as open as possible with the data, while respecting GDPR and the integrity of the results and meetings.
We have had a few implementations of our APIs over the years. Going forward, we intend to support one approach based on URL patterns like https://data.opentrack.run/api/hello/
Authenticating¶
1. Log in and get a JSON web token¶
import requests
import os
username = os.environ.get("username", "api-test@mailinator.com")
password = os.environ.get("password", "apitest")
BASE_URL = 'https://test-data.opentrack.run/'
r1 = requests.post(BASE_URL + 'api/get-auth-token/', data=dict(username=username,
password=password))
try:
token = r1.json()["token"]
print("Got a token: %s..." % token[0:30])
except KeyError:
print("Unable to authenticate, check credentials")
2. Check authentication with hello API¶
r2 = requests.get(BASE_URL + "api/hello/", headers={
"Authorization": "Token " + token
})
print(r2.json())