AnsweredAssumed Answered

Canvas Data API Sync Route and Expiring Download Urls

Question asked by Derek Law on Dec 16, 2016
Latest reply on Jan 24, 2017 by Derek Law

      I am running into an issue when using the "/api/account/self/file/sync" endpoint on the Canvas Data API. Within the returned json, each file has a download url. Within each download url there is an 'expires=<epoch timestamp>" that indicates the time the download url will expire. After looking into these timestamps, it appears that each download url expires 2 hours after you hit the sync endpoint. Two hours is more than enough time to download one file; however, this is not enough time for us to loop through the entire json object to hit and download from each download url. As you can imaging, after 2 hours my application stops hitting legitimate urls.

       The documentation doesn't seem to mention anything about handling the expiring urls. My process is essentially the process the documentation recommends for the file/sync endpoint which is:


- Make a request to this API, for every file:

  - If the filename has been downloaded previously, do not download it

  - If the filename has not yet been downloaded, download it

- After all files have been processed, delete any local file that isn't in the list of files from the API


Is anyone else having this issue? How are others handling the expiring urls?