Get Completions
Completions include all current and archived completions within the LMS. Each completion record includes details about the user and the piece of content that was completed.
Get all completions:
Description |
Returns all activity completions within the tenancy. |
Request Method | GET |
Request URL | {{base_url}}/local/acorn_tenancymanagement/index.php/api/1.1/tenancies/{{tenancy_id}}/completions |
Authorisation Header | Bearer {api_key} |
Query String Parameters:
Parameter | Data Type | Details |
requestid | integer | optional, if included the endpoint will return the status and results of the request with the specified requestid. If not included a new request will be submitted and its requestid will be returned |
contentType | string |
optional, filter the results by contenttype Available Values:
|
contentId | integer | optional, if included the endpoint will only return results with the specified contentid. |
showSuspended | boolean | optional, if true the completions of suspended users will be included |
includeEnrolments | boolean |
optional, if true completion records will include enrolled and in progress users |
userFields | boolean |
optional, if true completion records will include all custom user fields |
Example Response without requestId included:
{
"requestid": 161,
"status": "Processing"
}
Example Response with requestId included:
{
"requestid": 161,
"status": "Processing"
}
{
"requestid": 161,
"status": "Complete",
"data": [
{
"userid": 33,
"username": "hope.renner@example.com",
"contentid": 39,
"contenttype": "Live Learning",
"contentname": "Safety Workshop",
"timeenrolled": "",
"timestarted": "2019-09-11T07:00:24+00:00",
"timecompleted": "2019-09-11T07:00:24+00:00",
"completionstatus": "Completed",
"comment": "Completed an older version",
"expiry": ""
},
{
"userid": 29,
"username": "toni54@example.com",
"contentid": 82,
"contenttype": "Course",
"contentname": "Fraud Awareness",
"timeenrolled": "2019-08-16T05:25:59+00:00",
"timestarted": "2019-09-03T22:20:28+00:00",
"timecompleted": "2019-09-03T22:20:28+00:00",
"completionstatus": "Completed",
"comment": "",
"expiry": "2021-09-03T22:20:28+00:00"
}
]
}
Post Completion
Create a single completion record within the LMS.
Post a completion:
Description |
Inserts a completion record within the tenancy. |
Request Method | POST |
Request URL | {base_url}/local/acorn_tenancymanagement/index.php/api/1/tenancies/{{tenancy_id}}/completions |
Authorisation Header | Bearer {api_key} |
Request Body:
Parameter | Data Type | Details |
contentName | string | optional, name of the content where the completion will be created, required if contentId is not provided |
contentId | integer | optional, id of the content where the completion will be created, required if contentName is not provided |
contentType | string | type of the content where the completion will be created, valid types: 'Course', 'Live Learning' |
username | string | username or email of the user who the completion record will be created for |
dateCompleted | date(YYYY-MM-DDTHH:MM:SSZ) | the date, time and timezone of the content completion, following the ISO 8601 format |
comment | string | optional, comment to be stored along with the completion record |
Example Response:
{
"status": "Complete"
"data": {
"success": "Saved archived course completion."
}
}
Example Error Response:
{
"status": "Failed",
"errors": {
"The following user could not be found with the provided details: user@example.com"
}
}
1
1
Was this article helpful?
1 out of 1 found this helpful
Add comment
Please sign in to leave a comment.