Skip to content
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

Max number of requests #67

Open
RBerntsen opened this issue Nov 20, 2020 · 5 comments
Open

Max number of requests #67

RBerntsen opened this issue Nov 20, 2020 · 5 comments

Comments

@RBerntsen
Copy link

Hi @nufyoot (and everyone else).

I have inherited a solution with an integration to Campaign Monitor. The user can subscribe to multiple lists which results in a foreach loop like this:

                AuthenticationDetails authenticationDetails = new ApiKeyAuthenticationDetails(apiKey);

                foreach (var selectedListId in model.SelectedListIds)
                {
                    var subscriber = new Subscriber(authenticationDetails, selectedListId);

                    var customFieldsList = new List<SubscriberCustomField>
                    {
                        CreateSubscriberCustomField(FormConstants.Position, model.Position),
                        CreateSubscriberCustomField(FormConstants.PlaceOfWork, model.PlaceOfWork)
                    };

                    model.Name = model.FirstName + " " + model.LastName;

                    subscriber.Add(model.Email, model.Name, customFieldsList, true, ConsentToTrack.Yes);
                }

The first couple of submits goes fine but after some iterations it starts throwing a "429 too many requests". I can't see any headers in the response that tells me about a limit or anything. I wonder if there's a known limit of requests you can do in a certain time frame? I have been looking at the documentation but I don't see any regarding this issue and furthermore I can't see if this should have been structured differently.

@LancesCM
Copy link

Hi,

A 429 when adding a subscriber only occurs if you have added the same subscriber/email to your account in quick succession. In this case your process appears to add the same subscriber/email to many lists at once which is the same as adding the same email to your account in quick succession.

We strongly encourage the use of segmenting a list of subscribers to send a campaign; but if your workflow really needs it to work this way you can send the support team at Campaign Monitor an email and they can set your account to bypass this duplication check.

@RBerntsen
Copy link
Author

Hi @LancesCM
Thanks for the quick reply. Can you give some pointers (e.g. documentation) to this? Sounds like it's structured incorrectly as of now? Basically we just need to add a user to a number of lists, depending on which they select.

@ghost
Copy link

ghost commented Jan 12, 2021

Hi,
I got the same issue. Is it not a bit harsh to return a 429 when adding an email to your account in quick succession?
At least when there is no operation to add an email to multiple lists at the same time? It seems like a very basic request.

Is there a way, using this wrapper, to see for how long you are supposed to back off?

thanks!

@LancesCM
Copy link

What you are seeing is the result of an abuse prevention feature on our side. You can contact our Support team and specifically request to opt out of this feature. We do not allow that to be done through the API.

@ghost
Copy link

ghost commented Jan 12, 2021

Just contacted support, and got a very quick reply!
It makes sense, and we will look into a workaround.
Support mentioned that if we want to turn the 429 errors off we will need captcha or a similar method to ensure fake subscribers are not added.

@LancesCM thank you very much for the quick response!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants