Why does GET /d2l/api/le/(version)/(orgUnitId)/calendar/events/user/ return data for more than...
Why does GET /d2l/api/le/(version)/(orgUnitId)/calendar/events/user/ return data for more than one orgUnitId?
I'm working with the GET /d2l/api/le/(version)/(orgUnitId)/calendar/events/user/ endpoint and am a bit confused about the returned data. I have a student that is registered in 3 different courses. When I call the endpoint for each orgUnitId it looks like the endpoint is returning data for all 3 courses, not just the one specified in the URL. Re-reading the description for the endpoint leads me to believe that I can supply one orgUnitId for a student and it will return calendar data for all current orgUnits that belong to the institution and the student is registered for. Am I understanding this correctly?
Answers
-
So, the route you are calling "Retrieves all the calendar events for a specified user’s explicit enrollments within the organization containing the specified org unit.", so using the orgunit, we retrieve all enrollments for the organization containing that org unit, and then all calendar events associated to all those org units. I agree that it's confusingly worded. I think in order to accomplish what you're looking to do, you need to call this route with the credentials of the user whom you would like to get events for.
-
Thank you for the quick response and confirming my thoughts Joseph. The page I'm writing will be used in our student website to display any upcoming events and the page will not have access to the students credentials to utilize the other Calendar events. My current thought is since calling one org unit with this endpoint will return all enrollment calendar data for a student id that this solution will work fine.
Thanks again for your input!