Your Community is getting an upgrade!
Read about our partnership with Higher Logic and how we will build the next generation of the Instructure Community.
Found this content helpful? Log in or sign up to leave a like!
I would like to use the Microsoft Power Platform to connect to Canvas LMS. Specifically, I want to download Course Syllabi and save them in Sharepoint. I have some limited experience with Power Platform's REST API's. I created an API Developer Key in Canvas. It's not clear to me what specific requests I need to make in order to get an access token. I found some documentation on Canvas OAuth2 and Canvas developer keys but nothing that specifically tells me what I need to send to get the token.
Thanks!
Solved! Go to Solution.
Hi @EdwardPriest,
So two things...
1 - The API endpoint you referenced is to list the courses in the public index (this is courses that have the "Include this course in the public course index" option enabled in the course settings). I don't think this is the endpoint you actually mean to use. If you want to geta. list of all courses, instead try the list active courses in an account endpoint, which I think is going to get you the results you expected.
2 - You did confirm you're an administrator, but I'm not sure if you're a full root admin, or if you have more limited access (either by being a subaccount admin, or a root account admin with a lower than full admin role). API calls always obey your permissions, so if you're not a full root admin, there may be some calls you cannot access, or some calls where the data returned will only be what you have access to, and may not be a full dataset for your entire school/institution.
Hope this helps!
-Chris
That sounds like you aren't handling pagination. The default number returned is 10 and you have to use pagination to get the next page of results. You can also add a query parameter to change the default per_page from 10 to 100.
You don't need to go through OAuth2 to get the token, you can create a token from your account following the instructions here https://community.canvaslms.com/t5/Admin-Guide/How-do-I-manage-API-access-tokens-as-an-admin/ta-p/89
Then add it in the header as Authentication Bearer $token
I actually tried that originally, but I was only seeing course info for my own account. I thought a developer key would be needed to see course info for all current students. Was that incorrect?
Hi @EdwardPriest,
In order to see all courses, you would need at API key from a Canvas administrator's account, or have your account promoted to an Admin in Canvas. This would generally need to be done by your school/institution Canvas team (usually in the eLearning / IT / Digital Education areas).
Hope this helps!
-Chris
Thanks! I have an Admin account and I have created the API developer key. I'm not sure exactly what parameters and such to pass into the REST API to get the access token.
Alternatively, you mention "or have your account promoted to Admin in Canvas". My account is an admin, but I still can't view all courses.
Here's a specific example:
https://[my_university].instructure.com/api/v1/search/all_courses?access_token=[my token]
Returns the following:
Hi @EdwardPriest,
So two things...
1 - The API endpoint you referenced is to list the courses in the public index (this is courses that have the "Include this course in the public course index" option enabled in the course settings). I don't think this is the endpoint you actually mean to use. If you want to geta. list of all courses, instead try the list active courses in an account endpoint, which I think is going to get you the results you expected.
2 - You did confirm you're an administrator, but I'm not sure if you're a full root admin, or if you have more limited access (either by being a subaccount admin, or a root account admin with a lower than full admin role). API calls always obey your permissions, so if you're not a full root admin, there may be some calls you cannot access, or some calls where the data returned will only be what you have access to, and may not be a full dataset for your entire school/institution.
Hope this helps!
-Chris
Thanks, Chris!
I ran the following:
https://[my_university].instructure.com/api/v1/accounts/self/courses
And received a response that contained info for about 10 courses, mostly sandbox stuff. Is that indicative of not having full root admin access?
That sounds like you aren't handling pagination. The default number returned is 10 and you have to use pagination to get the next page of results. You can also add a query parameter to change the default per_page from 10 to 100.
You were correct! Thank you for the help.
To 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