Introduction
In this article, we describe how to get the start and end dates of a course session with the help of Learn365 API endpoints. There are several ways to accomplish this, depending on whether you have the ID of the relevant course or session.
Get data using a course ID
To use the Learn365 API, you should be authorized with the relevant API key. For details, see this article.
To get the start and end dates of a session in a specific course, follow the steps:
1. In https:/api.365.systems, navigate to the Courses section and expand it.
2. Select the GET/odata/v2/Courses endpoint that returns the course by its ID and select Try it out.
3. The opened Parameters section includes the query parameter fields to be completed:
- In the required Id field, enter the ID of the course you want to get the session start and end dates.
- In $expand, enter CourseSessions. The data on the course sessions will be included in the response.
4. Select Execute to run the request.
5. In the Responses block, check the results:
- Number 2xx (for example, 200) under Code shows that the request worked correctly.
- You can use the Download option to save the results in the JSON format to your device.
- The response contains data only of the course the ID of which was specified in Parameters, its sessions and session groups, including the data of the sessions start and end dates:
- The start and end dates for standalone sessions and sessions in a session group are specified next to the corresponding parameters.
-
- For session groups (IsGroup has the true value), the StartDate and EndDate parameters always show 1753-01-01T00:00:00Z and 9999-12-31T23:59:59.997Z, respectively. The session groups don't have start and end dates, only sessions (standalone and within a session group) have the specified dates.
Get data using a session ID
To use the Learn365 API, you should be authorized with the relevant API key. For details, see this article.
The benefit of using this approach to obtain the start and end dates of a session with a session ID is that it provides only the necessary information about the specific session.
To get the start and end dates of a specific course session, follow the steps:
1. In https:/api.365.systems, navigate to the CourseSessions section and expand it.
2. Select the GET/odata/v2/CourseSessions({Id}) endpoint that returns data on course session or session groups by its ID and select Try it out.
3. The opened Parameters section includes the query parameter fields to be completed. In the required Id field, enter the ID of the session you want to get the start and end dates.
4. Select Execute to run the request.
5. In the Responses block, check the results:
- Number 2xx (for example, 200) under Code shows that the request worked correctly.
- You can use the Download option to save the results in the JSON format to your device.
- The returned data is related to this specific session, including its start and end dates.
Get data without a course or session ID
To use the Learn365 API, you should be authorized with the relevant API key. For details, see this article.
To get the start and end dates of a session you don't have the course or session ID of, follow these steps:
1. In https:/api.365.systems, navigate to the Courses section and expand it.
2. Select the GET /odata/v2/Courses endpoint that returns the list of courses and then select Try it out.
3. The opened Parameters section includes various query options parameters that can be specified to control the data in the response.
EXAMPLE
In the $expand field, enter CourseSessions. As a result, the response will contain the courses of the tenant that will include data on their sessions.
4. Select Execute to run the request.
5. In the Responses block, check the results:
- Number 2xx (for example, 200) under Code shows that the request worked correctly.
- You can use the Download option to save the results in the JSON format to your device.
- The Response body contains the list of courses and their data, including data of its sessions and session groups. Sessions start and end dates are shown under CourseSessions, next to the StartDate and EndDate parameters, respectively.
Comments
Article is closed for comments.