The Instructure Community will enter a read-only state on November 22, 2025 as we prepare to migrate to our new Community platform in early December. Read our blog post for more info about this change.
Found this content helpful? Log in or sign up to leave a like!
Hi all,
I'm tryin to use some services from the Canvas API. When i send the request (myhost/some/service. Header: Authorization, Bearer fF...) the response says: "InvalidOauthTokenException". I've test with three diferents ways to get a token but it still failling.
1. Acount > settings > new access auth
2. Admin > Site Admin > developer key
3. Admin > UserName > developer key
Someone knows the correct way to get a funcionally token?
Regards
Hi @jguerrero1
Are you trying to authenticate these API requests from within the browser or a backend application?
Hi Robert,
Thank you for reply.
Both ways. Same response:
{
"errors": [
{
"message": "Invalid access token."
}
]
}
Regards
I recall you were trying to setup a self hosted or developer instance of Canvas so, if we try to troubleshoot from the Browser first maybe we'll identify an issue faster.
If you make the API call using jQuery in the browser developer tools/console do you have the same issue?
The built-in jQuery should self sign requests for the current user. Just a place to start trouble shooting.
At (2) and (3) note that a Developer Key is not the same as an access token. To get an access token with a Developer Key, you need to go through the OAuth process (see OAuth2 - Canvas LMS REST API Documentation).
(1) should give you a Manual Token (OAuth2 - Canvas LMS REST API Documentation), assuming your "new access auth" is the "New Access Token" button (at least that's what I see).
The manual token should work as you have tried. Maybe re-generate it and copy it carefully.
If that still does not work, perhaps post exactly how you are using it in your programming language. Easiest is if you can try a simple command-line example with curl. For example:
curl -k -X GET $server/api/v1/accounts/1/courses \
-H "Authorization: Bearer $token"
Hi Peter,
I copied the Acces token correctly, i'm pretty sure.
And... yes, still failling, even with curl.
Community helpTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign inTo interact with Panda Bot, our automated chatbot, you need to sign up or log in:
Sign in