Teams API Documentation
- Last updated on July 8, 2023 at 2:33 AM
While we provide an option to download reports from the Team Progress page, APIs can help you generate a custom report that gets updated automatically.
Only team admins can generate an API key.
Generating an API Key
To generate an API key, either visit this link or:
- Click the Avatar icon on the top left corner of your dashboard
- Select Team Admin
- Click the API Keys tab on the left
- Click the Generate button
For security reasons, your API key is only displayed upon generation. Make sure to safely store your API key once generated.
Generating a new API key will deactivate any existing API key!
Authentication
To authenticate with our REST API, the
Api-Key
header must be provided with the provisioned API Key.
Python
headers = { 'API-Key': '<Paste your API KEY here>' }
Endpoints
The base API URL is
https://app.dataquest.io/api/team-reports/<team_id>/
.
You can obtain your team id by creating a ticket. Our app currently supports
the following endpoints.
- course_progress
- mission_progress
- invitations_status
- time_spent
- all
All of these endpoints return JSON data and support the following arguments.
- start_date: (DD/MM/YYYY format)
- end_date: (DD/MM/YYYY format)
Please note that we only allow 10 requests per minute. Once it is exceeded, you will receive the following response:
{'detail': 'Request was throttled. Expected available in 38 seconds.'}
Examples
Retrieving course progress without a date range
Python
# import requests module import requests headers = { 'API-Key': '<Paste your API KEY here>' } # Making a get request response = requests.get('https://app.dataquest.io/api/team-reports/<team_id>/course_progress', headers=headers) # print response print(response.json())
Output
[ { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "language":"Python", "dttm_course_started":"2022-02-16T13:16:08.523Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:15.157Z" } ]
Retrieving course progress with a date range
# import requests module import requests headers = { 'API-Key': '<Paste your API KEY here>' } params = { 'start_date': '14/02/2022', # DD/MM/YYYY 'end_date': '17/02/2022' # DD/MM/YYYY } # Making a get request response = requests.get('https://app.dataquest.io/api/team-reports/<team_id>/course_progress', headers=headers, params=params) # print response print(response.json())
Retrieving all data
# import requests module import requests headers = { 'API-Key': '<Paste your API KEY here>' } # Making a get request response = requests.get('https://app.dataquest.io/api/team-reports/<team_id>/all', headers=headers) # print response print(response.json())
Output
{ "invitation_status":[ ], "time_spent":[ { "learner_name":"<name>", "email":"<email>", "dttm_started_learning":"2022-02-16T12:18:17.206Z", "last_login":"2022-02-16T12:16:09.692Z", "hours spent":0.0 }, { "learner_name":"<name>", "email":"<email>", "dttm_started_learning":"2022-02-16T12:22:30.462Z", "last_login":"None", "hours spent":0.0 }, { "learner_name":"<name>", "email":"<email>", "dttm_started_learning":"2022-02-16T12:21:56.475Z", "last_login":"None", "hours spent":0.0 } ], "course_progress":[ { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "language":"Python", "dttm_course_started":"2022-02-16T13:16:08.523Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:15.157Z" } ], "mission_progress":[ { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "mission":"Python Programming", "language":"Python", "dttm_started_mission":"2022-02-16T13:16:08.856Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:08.862Z" }, { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "mission":"Programming Python Variables", "language":"Python", "dttm_started_mission":"2022-02-16T13:16:10.475Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:10.480Z" }, { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "mission":"Python Data Types: Integers, Floats, Strings", "language":"Python", "dttm_started_mission":"2022-02-16T13:16:12.161Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:12.167Z" }, { "learner_name":"<name>", "email":"<email>", "last_login":"2022-02-16T12:16:09.692Z", "path":"Data Analyst in Python", "step":1, "course":"Variables, Data Types, and Lists in Python", "mission":"Python Lists", "language":"Python", "dttm_started_mission":"2022-02-16T13:16:13.924Z", "progress_pct":100, "dttm_completed":"2022-02-16T13:16:13.930Z" } ] }