○ API calls - Events
The API calls make it possible to
- add new events
- change properties of existing events
- (un)link instructors and events
- (un)link events and event activities
Context
Courses in aNewSpring consist of activities. One such activity is the event activity. Multiple events can be linked to one event activity, this gives learners the option to choose in which of the events they want to participate. The learner will then be a participant of the event.
Events can also have an instructor. The instructor can change the event properties and assess the participants (learners) with a score if scoring is enabled. It's also possible to enable the instructors to assess by attendance, but only if scoring is not enabled.
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:
- An Event is called a BookableEvent. This is not to be confused with Calendar items, which are called "Event" in the API. Calendar items are not part of the API calls in this support article.
- An Instructor is called a Teacher.
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 /getBookableEventSubscriptions/{eventID}
or POST /getBookableEventSubscriptions?eventID={eventID}
Use this to get all subscriptions of an event. You will need to use the external ID (eventID) of the event.
POST requests
POST /addBookableEvent/{eventID}
Use this to create a new event. The event will get the external ID that you specify as eventID.
POST /updateBookableEvent/{eventID}
Use this to change the properties of a specific event. You will need to use the external ID (eventID) of the event.
POST /addOrUpdateBookableEvent/{eventID}
You can use this if you're not sure if an event already exists. If the event already exists, it will work as /updateBookableEvent and only accept those parameters. If the event doesn't exist yet, it will work as /addBookableEvent and only accept those parameters. You will need to use the external ID (eventID) of the event.
POST /addBookableEventTeachers/{eventID}
Use this to link instructors to a specific event. You will need to use the external ID (eventID) of the event and external IDs of the users (instructors), which can be sent as an array in the parameter user, by repeating the same parameter with different values. Instead of the external IDs of the users, you can also use the UIDs of the users as an array in the parameter userUID.
POST /deleteBookableEventTeachers/{eventID}
Use this to unlink instructors from a specific event. You will need to use the external ID (eventID) of the event and external IDs of the users (instructors), which can be sent as an array in the parameter user, by repeating the same parameter with different values. Instead of the external IDs of the users, you can also use the UIDs of the users as an array in the parameter userUID.
POST /linkBookableEvent/{eventID}/{courseID}/{activityID}
or POST /linkBookableEvent?eventID={eventID}&courseUID={courseUID}&activityUID={activityUID}
Use this to link an event to a specific event activity in a specific course. You will need to use the external ID (eventID) of the event and the external IDs (courseID/activityID) or UIDs (courseUID/activityUID) of the course and the event activity.
POST /unlinkBookableEvent/{eventID}/{courseID}/{activityID}
or POST /unlinkBookableEvent?eventID={eventID}&courseUID={courseUID}&activityUID={activityUID}
Use this to unlink an event from a specific event activity in a specific course. You will need to use the external ID (eventID) of the event and the external IDs (courseID/activityID) or UIDs (courseUID/activityUID) of the course and the event activity.
POST /subscribeBookableEvent/{userID}/{eventID}
or POST /subscribeBookableEvent?userUID={userUID}&eventUID={eventUID}
Use this to subscribe a learner to an event. You will need to use the external IDs (userID/eventID) or UIDs (userUID/eventUID) of the learner and event. If there are multiple activities that are linked to the same event you will need to include the external ID of the course (courseID) or activity (activityID) to specify which one the learner needs to be subscribed to.
POST /unsubscribeBookableEvent/{userID}/{eventID}
or POST /unsubscribeBookableEvent?userUID={userUID}&eventUID={eventUID}
Use this to unsubscribe a learner from an event. You will need to use the external IDs (userID/eventID) or UIDs (userUID/eventUID) of the learner and event.