Introduction
In this article, we describe how to get the start and end dates of a course session with the help of LMS365 API endpoints. There are several ways to do this depending on whether you have the ID of the relevant course or session, or no ID is provided.
Get data using course ID
When you need to get the start and end dates of a session and you have the ID of the relevant course, do the following:
1. Go to https://api.365.systems/ and authorize with the relevant API key. You can find more about the authorization process here.
2. Find the Courses section, expand it, find the GET method /odata/v2/Courses with the Returns the Course by Id description and then select Try it out in the top right corner.
3. Fill in the fields: for the Id field enter the ID of the course you want to get the session's start and end dates, and for $expand enter CourseSessions. Using the course ID and the $expand query option, you won't need to make an additional search through the list of all courses of the tenant.
Select Execute to run the request.
4. Go to the Responses block to 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 computer.
- In the Response body field, you will see the course of that specific ID and its session groups and sessions, including the data of the sessions' start and end dates.
Standalone sessions and sessions inside a session group have the start and end dates next to the corresponding parameters.
For session groups (GroupId has the true value), the StartDate and EndDate parameters show 1753-01-01T00:00:00Z and 9999-12-31T23:59:59.997Z, respectively.
Get data using session ID
The advantage of this method is that you get only the required information about the specific session.
To get the start and end dates of a specific course session and you have the ID of this session, do the following:
1. Go to https://api.365.systems/ and authorize with the relevant API key. You can find more about the authorization process here.
2. Find the CourseSessions section, expand it, find the GET method /odata/v2/CourseSessions({Id}) with the Returns Course Session or Group of Sessions by id description and then select Try it out in the left corner.
3. Fill in the key: Id field with the ID of the session you want to find the start and end dates of and select Execute to run the request.
4. Go to the Responses block to 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 computer.
- In the Response body field, you will see the data related to this specific session, including its start and end dates.
Get data without course or session ID
To get the start and end dates of a session you don't have the course or session ID of, follow these steps:
1. Go to https://api.365.systems/ and authorize with the relevant API key. You can find more about the authorization process here.
2. Find the Courses section, expand it, find the GET method /odata/v2/Courses with the Return the list of Courses description and then select Try it out in the top left corner.
3. In the $expand field, enter CourseSessions and select Execute to run the request.
You can use various query options parameters to control the data in the response by setting filters which allows the response to include additional data and details which you can use for search.
4. Go to the Responses block to 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 computer.
- In the Response body field, you will see the list of courses of the data of, including data of its sessions and session groups. Session start and end dates are shown under CourseSessions, next to the StartDate and EndDate parameters, respectively.
Comments
Article is closed for comments.