Returns all training assignments data that has been created or modified for your organization based on the time parameters passed in. Results are paginated and are sorted by last modified date. If you include an endTime, the endpoint will return data up until that point (exclusive). If you don’t include an endTime, the API will continue to poll with the pagination cursor that gets returned on every call. The hasNextPage response value will be true if there is no endTime specified and endCursor is nonempty.
Rate limit: 5 requests/sec (learn more about rate limits here).
To use this endpoint, select Read Training Assignments under the Training Assignments category when creating or editing an API token. Learn More.
Submit Feedback: Likes, dislikes, and API feature requests should be filed as feedback in our API feedback form. If you encountered an issue or noticed inaccuracies in the API documentation, please submit a case to our support team.
curl --request GET \
--url https://api.samsara.com/training-assignments/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"course": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"revisionId": "1214a1fa-f0c6-408b-bf85-51dc3bc71ac7"
},
"createdAtTime": "2019-06-13T19:08:25Z",
"createdById": "user-4392",
"durationMinutes": 3495523726907889000,
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"learner": {
"id": "938172",
"type": "driver"
},
"status": "inProgress",
"updatedAtTime": "2019-06-13T19:08:25Z",
"updatedById": "user-3112",
"completedAtTime": "2019-06-13T19:08:25Z",
"deletedAtTime": "2019-06-13T19:08:25Z",
"dueAtTime": "2019-06-13T19:08:25Z",
"isCompletedLate": true,
"isOverdue": true,
"scorePercent": 0.770019485813057,
"startedAtTime": "2019-06-13T19:08:25Z"
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}Documentation Index
Fetch the complete documentation index at: https://samsara-showcase.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
If specified, this should be the endCursor value from the previous page of results. When present, this request will return the next page of results that occur immediately after the previous page of results.
A start time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
An end time in RFC 3339 format. Defaults to now if not provided. Millisecond precision and timezones are supported. (Examples: 2019-06-13T19:08:25Z, 2019-06-13T19:08:25.455Z, OR 2015-09-15T14:00:12-04:00).
Optional string of comma separated learner IDs. If learner ID is present, training assignments for the specified learner(s) will be returned. Max value for this value is 100 objects. Example: learnerIds=driver-281474,driver-46282156
Optional string of comma separated course IDs. If course ID is present, training assignments for the specified course ID(s) will be returned. Max value for this value is 100 objects. Defaults to returning all courses. Example: courseIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075
Optional string of comma separated values. If status is present, training assignments for the specified status(s) will be returned. Valid values: "notStarted", "inProgress", "completed". Defaults to returning all courses.
Optional boolean value. If present, training assignments for the specified overdue status will be returned. Valid values: true, false. Defaults to returning all assignments.
Optional string of comma separated category IDs. If category ID is present, training assignments for the specified category ID(s) will be returned. Max value for this value is 100 objects. Example: categoryIds=a4db8702-79d5-4396-a717-e301d52ecc11,c6490f6a-d84e-49b5-b0ad-b6baae304075
curl --request GET \
--url https://api.samsara.com/training-assignments/stream \
--header 'Authorization: Bearer <token>'{
"data": [
{
"course": {
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"revisionId": "1214a1fa-f0c6-408b-bf85-51dc3bc71ac7"
},
"createdAtTime": "2019-06-13T19:08:25Z",
"createdById": "user-4392",
"durationMinutes": 3495523726907889000,
"id": "9814a1fa-f0c6-408b-bf85-51dc3bc71ac7",
"learner": {
"id": "938172",
"type": "driver"
},
"status": "inProgress",
"updatedAtTime": "2019-06-13T19:08:25Z",
"updatedById": "user-3112",
"completedAtTime": "2019-06-13T19:08:25Z",
"deletedAtTime": "2019-06-13T19:08:25Z",
"dueAtTime": "2019-06-13T19:08:25Z",
"isCompletedLate": true,
"isOverdue": true,
"scorePercent": 0.770019485813057,
"startedAtTime": "2019-06-13T19:08:25Z"
}
],
"pagination": {
"endCursor": "MjkY",
"hasNextPage": true
}
}