I am getting this message when trying to look at missing submissions for students, my code is as follows:
user_nm_and_ids_dict= get_user_names_and_ids() ##returns a dictionary containing every student's name and id.
for name in user_nm_and_ids_dict:
print(name)
user_id= int(user_nm_and_ids_dict[name])
user= course.get_user(user_id)
missing_submissions= user.get_missing_submissions()
print(missing_submissions) ##does end up printing out <PaginatedList of type Assignment>
for missing_submission in missing_submissions: ##this is where I get my error
print(missing_submission)
The official error I am receiving in terminal is as follows:
Traceback (most recent call last):
File "c:\Users\dylan\coding\Canvas API Playground\creating_pages_schoolcourseexample.py", line 110, in <module>
for missing_submission in missing_submissions:
File "C:\Users\dylan\AppData\Local\Programs\Python\Python39\lib\site-packages\canvasapi\paginated_list.py", line 48, in __iter__
new_elements = self._grow()
File "C:\Users\dylan\AppData\Local\Programs\Python\Python39\lib\site-packages\canvasapi\paginated_list.py", line 92, in _grow
new_elements = self._get_next_page()
File "C:\Users\dylan\AppData\Local\Programs\Python\Python39\lib\site-packages\canvasapi\paginated_list.py", line 56, in _get_next_page
response = self._requester.request(
File "C:\Users\dylan\AppData\Local\Programs\Python\Python39\lib\site-packages\canvasapi\requester.py", line 243, in request
raise Unauthorized(response.json())
canvasapi.exceptions.Unauthorized: [{'message': 'user not authorized to perform that action'}]