Max Amount of API requests?

283 views
Skip to first unread message

nicola...@maine.edu

unread,
Sep 8, 2014, 2:06:42 PM9/8/14
to canvas-l...@googlegroups.com
I have noticed that in my PHP code after several API requests the code seems to begin to return no information. Then, if I wait half an hour to an hour it seems to start working again. This process just continues over and over again.

Therefore! My question is:

Does the Canvas API only allow a certain amount of API requests every x amount of time?

Midiman

unread,
Sep 10, 2014, 7:28:11 PM9/10/14
to canvas-l...@googlegroups.com, nicola...@maine.edu
If you're asking about the cloud instances of Canvas provided by Instructure, the word on the street is that it's 3000 requests/hr. Does your code exceed that amount?

It would be good to get someone from Instructure on this thread to confirm that number.

Michael Ball

unread,
Sep 11, 2014, 3:12:22 AM9/11/14
to canvas-l...@googlegroups.com, nicola...@maine.edu
I've seen this page:

I'm currently working on some scripts to automate posting grades and it currently is having trouble where about half the requests in a row fail. Then if I wait a few seconds, they work. I'm not sure if it's canvas or something else, but I'm not getting much in the way of error messages other than "an error occurred". 

On Monday, September 8, 2014 11:06:42 AM UTC-7, nicola...@maine.edu wrote:

Cody Cutrer

unread,
Sep 11, 2014, 11:48:08 AM9/11/14
to canvas-l...@googlegroups.com, nicola...@maine.edu
https://github.com/instructure/canvas-lms/blob/stable/lib/canvas/request_throttle.rb is the logic for throttling. It's a leaky bucket algorithm, rather than a flat "x requests/hour". If that's what you're hitting, you'll be getting a 403 response, with a specific message saying "Rate Limit Exceeded".

Cody Cutrer
Software Engineer
Instructure

--

---
You received this message because you are subscribed to the Google Groups "Canvas LMS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to canvas-lms-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Randall Anderson

unread,
Sep 16, 2014, 3:17:09 PM9/16/14
to canvas-l...@googlegroups.com
Cody,

Are errors tided to individual access tokens? That is, is any single token only allowed to make so many calls in a certain amount of time?

I have vendor who is requesting additional tokens as they are seeing a lot error messages?

Randall
--
Respectfully Serving
--
Randall A. Anderson, M.Ed.
Programming Analyst Instructional Systems
Information Technology Services
Maricopa Community Colleges
---
Office: 480.731.8072
---
Cell:  480.580.6471

Cody Cutrer

unread,
Sep 16, 2014, 3:23:43 PM9/16/14
to canvas-l...@googlegroups.com
Randall,

Yes, errors are counted against the access token's bucket just like any other request. The only case would be if the error was with authenticating the token itself, at which point the request would count against the IP, instead of the (unfound) access token.

Cody Cutrer
Software Engineer
Instructure

Randall Anderson

unread,
Sep 16, 2014, 3:25:14 PM9/16/14
to canvas-l...@googlegroups.com
thank you...r
Reply all
Reply to author
Forward
0 new messages