360Learning
Our API lets you automate several instructions related to users, groups courses and programs.
By using our set of secured public functions, you can easily create connections between 360Learning and a third party software or a website.
To get your credentials and start using the API, please contact your Customer Success Partner (CSP).
Authentication Methods
To access the 360Learning API, you must authenticate in one of the following ways:
- API key as query parameter
- API key as header parameter
- OAuth 2.0 token
We recommend using the OAuth 2.0 token to avoid exchanging API keys in every API request.
API key as query parameter
To authenticate via the API key as a query parameter, include your credentials in each request with the following query parameters:
company: Your company IDapiKey: Your API key
The following is an example of a request authenticating via the API key as a query parameter, where company_id and api_key are placeholders for values that are specific to you.
curl --location --globoff 'https://app.staging.360learning-dev.com/api/v1/courses?company=company_id&apiKey=api_key'
API key as header parameter
To authenticate via the API key as a header parameter, include your credentials in each request with the following header parameters:
X-company-id: Your company IDX-apiKey: Your API Key
The following is an example of a request authenticating via the API key as a header parameter, where company_id and api_key are placeholders for values that are specific to you.
curl --location 'https://app.staging.360learning-dev.com/api/v1/courses' \
--header 'X-company-id: company_id' \
--header 'X-apiKey: api_key'
OAuth 2.0 token
To authenticate via OAuth 2.0 token, follow these steps:
- Generate an OAuth 2.0 token with the endpoint POST GenerateToken.
- Include the generated OAuth 2.0 token in the
Authorization: Bearerheader of each request.
The OAuth 2.0 token grants access to all the 360Learning API v1 resources and expires after one hour.
The following is an example of a request authenticating via the OAuth 2.0 token, where access_token is a placeholder for the OAuth 2.0 token generated with the POST GenerateToken endpoint.
curl --location 'https://app.staging.360learning-dev.com/api/v1/courses' \
--header 'Authorization: Bearer access_token'
Authentication errors
If authentication credentials are missing or incorrect, the 360Learning API returns an HTTP 401 Unauthorized status code with a JSON error message. Together, they provide actionable information for debugging.
Below is a list of possible authentication errors and solutions.
| Error message | Description |
|---|---|
"error": "missing_company_id" | The company ID or the access token are missing. - If you are authenticating via API Key, check that the company ID is included either as a query or a header parameter. - If you are authenticating via OAuth 2.0, check that the access token is included in the header. |
"error": "invalid_company_id" | The company ID is invalid. If you are authenticating via API Key, check that the company ID included either as a query or a header parameter is correct. |
"error": "invalid_api_key" | The API key is either missing or invalid. If you are authenticating via API key, check the following: - A valid API key is included either as a query or a header parameter. - The API key has not been revoked. |
"error": "invalid_token", "error_description": "invalid signature" | The access token is invalid. If you are authenticating via OAuth 2.0, check that the access token is not malformed or invalid. |
"error": "invalid_token", "error_description": "jwt expired" | The access token is expired. If you are authenticating via OAuth 2.0, generate a new access token and include your new access token in your request header. |
Use Cases
Our API routes allow our customers and partners to perform a large variety of use cases.
The purpose of the following chapters is to provide guidelines for how to leverage the API routes for common use cases.
Get the global catalog of Learning Items
getCourses
Provides a global list of all courses available in a platform. Be aware that all courses may not be visible to all users.
If necessary, the getCourse route provides a few more details on the course.
getProgramSessions
Provides a global list of all Program Sessions. For each, the list of subscribed users is provided.
getPaths
Provides a global list of all Paths, including Path sessions.
Get all Learning Statistics for a user
Learning statistics for a user will be typically retrieved from the following routes. These routes also allow to get the ongoing learning items for a user.
getUserPrograms
Returns all the program sessions to which the user has been assigned, individually, via a group or open registration. This includes finished programs. For each program session, progress and time spent are retrieved.
getUserCourses
Returns all the Courses a Learner has played or is playing. For each attempt on the Course, progress, time, score and date of completion are retrieved.
Get the Learning Items that a single Learner can see
A Learner can access a Learning Item if he/she has been assigned to it or if it belongs to the catalog of a group he belongs to.
A possible way to get the Learning Items a Learner has access to is to combine the 3 following routes plus the global catalog described in the previous section.
getUser
This route provides data about a user and in particular the list of groups he belongs to.
getGroupCatalog
To get the list of each course, program session and path that belong to the catalog of a group.
getGroupPrograms
To get the list of program sessions all users of the group are subscribed to.