amzn / selling-partner-api-models

This repository contains OpenAPI models for developers to use when developing software to call Selling Partner APIs.
Apache License 2.0
611 stars 733 forks source link

Return Code 429 - Too Many Active Keys #1416

Closed jhullparkseed closed 3 years ago

jhullparkseed commented 3 years ago

Yesterday c# code I was working on for getting orders was working fine (/orders/v0/orders). Today I wanted to build on the success so I added a nextToken type of process to get all requested orders, not just the first 100.

` OrdersV0Api ordersV0Api = new Amazon.SPAPI.Orders.OrdersV0Api("https://sellingpartnerapi-na.amazon.com"); GetOrdersResponse resppnse = new GetOrdersResponse();

            resppnse = ordersV0Api.GetOrders(marketplaceIds: new List<string>() { "MERCHANTID" }, createdAfter: DateTime.Now.AddHours(-12).ToString("yyyy-MM-dd hh:mm:ss"), createdBefore: DateTime.Now.ToString("yyyy-MM-dd"));
            allOrders.AddRange(resppnse.Payload.Orders);
            do
            {
                resppnse = ordersV0Api.GetOrders(marketplaceIds: new List<string>() { "MERCHANTID" }, nextToken: resppnse.Payload.NextToken);
                allOrders.AddRange(resppnse.Payload.Orders);

            } while (resppnse.Payload.NextToken != null);

I believe when I went to test the first call worked, but I got the this error on the call with nextToken:

{ "errors": [ { "message": "Too Many Active Keys", "code": "InvalidInput" } ] }

Now I am wondering if my calls are running into a nextToken still open so it does not allow starting over till the token is read? All I know is that other then adding in the nextToken parameter this worked and having done some research I found this type of error attached to nextToken happened elsewhere.

What is the cause of the error? Since I cannot now get a valid call it is hard to show results, but will be happy to show what I can. I can finds no documentation on this error or how to deal with it.

brenjt commented 3 years ago

There are many others that are having this same issue: https://github.com/amzn/selling-partner-api-models/issues/1412

parvathm commented 3 years ago

Hi,

This issue returning 'Too Many Active keys" is resolved. Please try making a request and let us know if you are still facing same issue. Sorry for the inconvenience caused.

Thanks, Parvathm, Selling Partner API Developer Support.

ramduq commented 3 years ago

Hi @jhullparkseed, I see you were able to get orders using the C# SDK. I'm stuck trying to initialize the OrdersV0Api instance, since the documentation available is only for Java and it includes some classes that do not correspond to the .NET ones. How did you initialize OrdersV0Api and the Configuration object? Could you please share the code?

Thanks