jondkinney / docusign_rest

A wrapper gem for the DocuSign REST API
MIT License
107 stars 167 forks source link

Rate limiting? #39

Open Tuckie opened 10 years ago

Tuckie commented 10 years ago

Any thoughts on adding rate limiting to the Client?

[API Call Limits](https://www.docusign.com/p/RESTAPIGuide/RESTAPIGuide.htm#GettingStarted/API Call Limits.htm) and API Best Practices

applications are not allowed to poll for envelope status more than once every 15 minutes

jondkinney commented 10 years ago

I haven't thought about it yet, no. What features would you be looking for at the gem level for rate limiting? Is it primarily to provide a better error to the user? Or perhaps you could detect that the call would hit a limit and schedule a background job to be processed in 15 min, etc. Let me know what your thoughts are. I'm happy to accept a pull request if it's a broad use case.

Tuckie commented 10 years ago

I unfortunately haven't figured out a great way to handle this myself, but I figured I would pose this question, as DocuSign appears to care about this. (not sure if they'll actually check during the approval process)

Tuckie commented 9 years ago

Docusign has since added API Rate limit headers that may be worth looking into:

X-RateLimit-Limit → 1000
X-RateLimit-Remaining → 996
X-RateLimit-Reset → 1425967200