Getting 401 when trying to use the API to access Analytics

Jump to solution
Community Novice

I am a complete beginner in using APIs, but I am trying to learn. I was trying to access the student activity analytics for a course I'm teaching, but I keep getting a 401 code as a return.

I have tried adding the token as part of the URL request:


And adding the header as a separate variable in the GET request

header <- "{Authorization : Bearer 1XXX0~9L1Im4w8XXXX}"

GET(url = url, header = head)

I am at a loss. Is it that analytics can only be accessed by certain users (meaning I'd have to ask for additional permissions from my IT department), or am I doing something wrong here?

Labels (1)
1 Solution
Community Champion

What role do you have in the course?

If you are a teacher you should be able to access that endpoint.

Does it work if you log in using your browser and then go to (no token required):

View solution in original post