○ API calls - Calendar items
The API calls make it possible to
- check if a calendar item exists
- add a new calendar item
- update details of an existing calendar item
- delete calendar items
Context
Courses in aNewSpring can have a calendar widget which contains calendar items. These can be either meetings or exams. A calendar item has a start and end date/time. A summary (which is the title of the calendar item) and a description. It must always have a summary, but a description is optional.
Support articles:
For historical reasons and to continue to support old API integrations, the terminology of the API and the front-end for administrators does not always match completely. In the API:
- A Calendar item is an Event. Not to be confused with "Events" that are called BookableEvent in the API.
- The external ID of a calendar item is called UID. Not to be confused with actual UIDs. Calendar items currently only have an external ID an no automatically generated UID.
API calls
You can view more information and an example of each API call in the API Documentation by clicking the titles below. However, all links go to the /apidocs page of a demo environment that you cannot use for your own testing purposes.
To test the API calls, you will need to change the first part of the URL to match the right learning environment.
GET requests
GET /getEvents
Use this to get a list of all calendar items.
GET /eventExists/{UID}
Use this to check if a specific calendar item already exists. You will need to use the external ID of the calendar item.
Only calendar items that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.
POST requests
POST /addEvent/{courseID}/{UID}
or POST /addEvent?courseUID={courseUID}&UID={UID}
Use this to add a new calendar item to a specific course.
There are two types of calendar items: Meeting and Exam. You also need to set a summary, which is the title of the calendar item.
You will need to use the external ID (courseID) or UID (courseUID) of the course and the calendar item will get the external ID that you specify in UID.
POST /updateEvent/{UID}
Use this to change the details of an existing calendar item. You will need to use the external ID of the calendar item.
Only calendar items that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.
POST /deleteEvent/{UID}
Use this to remove an existing calendar item. You will need to use the external ID of the calendar item.
Only calendar items that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.
POST /deleteCourseEvents/{courseID}
or POST /deleteCourseEvent?courseUID={courseUID}
Use this to remove all calendar items of a specific course. You will need to use the external ID (courseID) or UID (courseUID) of the course.