Backpack API Throttling

A few weeks ago Greg received an email from Jeremy over at 37signals asking us why we were hitting the Backpack API so frequently (we were hitting it every 10 seconds looking for reminders that were in need of attention). At that time he informed us that they would be implementing some API throttling in order to limit how many requests could come in from one IP. We were a little unsure what the actual throttling would be so we did what any great new two man company would do…we did nothing.

The thought was that when 37signals finished up their API throttling implementation, our code would break and we’d fix it appropriately since then we’d know what 37signals was doing with their API. Well, it looks like that throttling was put in place because our code broke with the API returning this error.

WebServiceRequesterError: Error occured (503): You have exceeded 10 calendar requests in a 5-second period. Please wait 5 seconds before retrying.

We added some code to the begin rescue blocks that surround the API calls to sleep for 5 seconds when we get this error message. The end result is some uglier code and processing that’s a little sluggish but it works now.

If you are a Reveille customer that was impacted by this issue, then please accept our apologies. If not then check out Reveille, it’s a sweet little app that automatically creates Backpack Reminders for your Backpack Calendar events.

Submit a Comment

Your email address will not be published. Required fields are marked *