CommMessages API call with Admin token - "user not authorised to perform that action"

Jump to solution
BenjaminSelby
Community Participant

I'm trying to query the '/v1/comm_messages' API end point using an admin-authorised token in Powershell, and I get the message "user not authorised to perform that action". Does anybody know why there would be a problem with this? The token works fine for all other requests. 

I've tried using user ids in the URI like so: '/api/v1/comm_messages?user_id=<###>' as well as with no URI parameters, and I get the same message both times. 

Would greatly appreciate anyone's help for this. 

0 Likes
1 Solution

From looking at the code for that endpoint: https://github.com/instructure/canvas-lms/blob/master/app/controllers/comm_messages_api_controller.r... it looks like you will need the view_notifications permission on an account (https://community.canvaslms.com/t5/Canvas-Resource-Documents/Canvas-Account-Role-Permissions/ta-p/38...), so if you are using an account that doesn't have that permission that's probably why you are seeing the error message.

View solution in original post