How to get a report on the pathway progress of a group?
WARNING This can only be used for the content within Bracken One.
Task
Get a report from a selected group about the pathway progress within the group.
Find endpoint
Go to the API Reference section of this documentation and to the controller called Public Report.
There you will find an endpoint called ‘/api/report/pathway_progress/group/{groupkey}/pathway/{pathkey}’ which will list the pathway progress of a group.
Click on the endpoint and it will open up to show more information.
Here we can see what this endpoint requires and the values that can be set for the attributes.
The result is a list of the pathway progress within a selected group.
Code
Here is example code in Python (3.6.8) of how to get a report from a selected group about the pathway progress within the group.
Note: This doesn’t include getting an Access Token to be able to communicate with the Bracken API. Please add the necessary code to get an Access Token.
# Declare your groupkey
groupkey = YOUR_GROUPKEY
# Declare your pathkey
pathkey = YOUR_PATHKEY
# using the endpoint to get a report from a selected group about the pathway progress within the group
urlGetReport = 'https://api.brackenlearning.com/api/report/pathway_progress/group/{groupkey}/pathway/{pathkey}'
response = s.get(urlGetReport)
print(response)
print(response.json())
The part to focus on for this tutorial is this line.
# using the endpoint to get a report from a selected group about the pathway progress within the group
urlGetReport = 'https://api.brackenlearning.com/api/report/pathway_progress/group/{groupkey}/pathway/{pathkey}'
Which is where we use the endpoint that we found in the API Reference document to get a report from a selected group about the pathway progress within the group.
Important to note
The parameters that we are declaring for the API call determine which group we are getting a report on for the selected pathway.
The groupkey
that is used in the URL of the get
call is unique within that domain and is a unique identifier for a specific group.
The pathkey
is a unique identifier for a specific path and it is required for each path to have one.
Response
The [200] response for this call will look like the example below.
[
{
"userkey": 0,
"username": "Test-User",
"zonekey": 0,
"resultkey": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"lessonkey": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"state": "string",
"title": "string",
"created": "2020-11-25T01:05:00.635Z",
"modified": "2020-11-25T01:05:00.635Z",
"achieved": "2020-11-25T01:05:00.635Z",
"certified": "2020-11-25T01:05:00.635Z",
"expires": "2020-11-25T01:05:00.635Z",
"status": "string"
}
]
This response will give an array of all of the users within the group and each user will be listed in this manner.