-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to retrieve X-RateLimit params through the API? #35
Comments
I noticed that the Rate Limits are provided in the As of Campaign Monitor support, the Rate Limit parameters are provided in EACH response regardless of the status code, e.g.:
So my question is: How can I access the response object in order to parse the HTTP Header parameters and finde these values? |
I am looking for a solution to this problem as well. Any luck? |
I was in contact with campaign monitor, they say that they don't provide examples.
|
Would I need to put that in the wrapper around where the requests are made? I was hoping to not touch the original set of wrapper codes at all. |
in your own code, you call the API, and you parse the response, if possible. I didn't try it, it's just what I'd try first. |
Hi. Whilst I have not tested this assumption, if you exceed the rate limit you should get a 429 response (as @baszero stated), this non 200 response should cause a CreateSendException to be raised containing the 429 code. You could then read this, and back off. It's not an ideal solution, but it does get you some of the way there. The Jersey client library doesn't make it easy to expose the response headers like you need, it looks like it would require some refactoring of the wrapper. |
Hi,
is there any example of how to process the result of a send request?
e.g. if you have
MessageSent[] result = smartEmail.send(smartEmailRequest);
how should you process the results?
I'm actually looking for a recommended solution on how to follow the rate limit which is returned by Campaign Monitor: https://www.campaignmonitor.com/api/getting-started/#rate_limiting
The text was updated successfully, but these errors were encountered: