Celebrate Excellence in Education: Nominate Outstanding Educators by April 15!
There is an API to start and run reports and check the status of a running report and when status=complete it will even give the download url of the report file: https://canvas.instructure.com/doc/api/account_reports.html
When attempting to download the report file using the API developer key authentication, it does not authenticate.
Now I'm stuck, how do I authenticate to programmatically download the report file? I've tried getting a refresh_token to use via google sso with no success. Is there some known way to authenticate programmatically for the report download URLs?
BTW, the download URLs simply end up redirecting through to insgate cloud files, why not provide the direct link in the API instead of a link that requires user authentication?
Why not provide a download link that allows developer key authentication before the redirect?
Solved! Go to Solution.
Unfortunately as I mentioned in my original post I could not use any of the canvas API authentication mechanisms to download the report file. Still seems silly to allow API access to start the report, check the status is completed, get the file_url for download, but not be able to use API authentication to allow the download.
What I have done to work around the deficiency is automate the user authentication login form with specific accounts user/pass.
Unfortunately as I mentioned in my original post I could not use any of the canvas API authentication mechanisms to download the report file. Still seems silly to allow API access to start the report, check the status is completed, get the file_url for download, but not be able to use API authentication to allow the download.
What I have done to work around the deficiency is automate the user authentication login form with specific accounts user/pass.
I have the same issue here and looking at the community, I can't find anyone having the same problem with the download url redirecting to the login page. Not sure if there's a method that is not known or something has changed recently.
For your step 5 and 6 could you get sample code of how that looks? The fact that you have to do this makes the csv download not that great, I can't see why you can't just pass the bearer token to 'authenticate' who is downloading it.
Thanks,
It turns out, in linux at least, the url needs to be in quotes for wget to get the file. Also be careful of u0026 or \u0026 in the url as that is supposed to be &. E.g. "...?download_frd=1u0026verifier=...." should "...?download_frd=1&verifier=..."
Do you have example code for this solution?
To participate in the Instructure Community, you need to sign up or log in:
Sign In
This discussion post is outdated and has been archived. Please use the Community question forums and official documentation for the most current and accurate information.