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

Orders.GetOrders() is returning "Empty target resource argument found error" after updating library Version 1.7.2 > 1.7.18 #743

Open
smithburger opened this issue Jun 26, 2024 · 7 comments

Comments

@smithburger
Copy link
Contributor

My application was using 1.7.2. I upgraded to 1.7.18 and Orders.GetOrders() stopped working. It is now returning "Empty target resource argument found error" no matter what inputs I give it. I have not had time to dive into this. If I get time and can figure it out I will post here. I wanted to say something now in case you or someone else knows what has changed recently.

I was able to downgrade back to 1.7.2 for now. I tried to downgrade to 1.7.10 to see if I could figure out which update broke it. 1.7.10 threw the error as well. It is somewhere between .2 and .10.

AmazonConnection connection = new AmazonConnection(new AmazonCredential()
{
    AccessKey = ConfigurationManager.AppSettings["accessKey"],
    SecretKey = ConfigurationManager.AppSettings["secretKey"],
    RoleArn = ConfigurationManager.AppSettings["roleARN"],
    ClientId = ConfigurationManager.AppSettings["clientId"],
    ClientSecret = ConfigurationManager.AppSettings["clientSecret"],
    RefreshToken = ConfigurationManager.AppSettings["refreshToken"],
    MarketPlace = MarketPlace.US
});

var parameterOrderList = new ParameterOrderList
{
    CreatedAfter = DateTime.UtcNow.AddHours(-120),
    OrderStatuses = new List<OrderStatuses> { OrderStatuses.Unshipped },
    MarketplaceIds = new List<string> { MarketPlace.US.ID },
    IsNeedRestrictedDataToken = true
};

var amazonOrders = connection.Orders.GetOrders(parameterOrderList);
@michaelsowa
Copy link

I am also experiencing this issue.

I removed the AccessKey, SecretKey and RoleARN as they are no longer required. However, when I set IsNeedRestrictedDataToken to true I get that same message.

When IsNeedRestrictedDataToken is false I do get orders data successfully.

@michaelsowa
Copy link

Just to confirm - I can accomplish this via Postman without an issue

@michaelsowa
Copy link

Further update - when I added this:

RestrictedDataTokenRequest = new CreateRestrictedDataTokenRequest { restrictedResources = new List<RestrictedResource> { new RestrictedResource { method = Method.GET.ToString(), path = ApiUrls.OrdersApiUrls.Orders, dataElements = new List<string> { "buyerInfo", "shippingAddress" } } } }

To my params, it works.

@shoecake
Copy link

Unfortunately this is not a complete solution. If the GetOrders call will return > 100 orders then the orders after the first 100 will not have the PII data in. I.e. the first call is fine, but if a NextToken is retuned then the subsequent requests have no PII data returned. I.e. the GetGetOrdersByNextTokenAsync function is not using the RestrictedDataToken

@mjw2022
Copy link

mjw2022 commented Sep 25, 2024

Was there a fix for this error, as I upgraded ver 1.7.27 today and have the same issue? Thanks

@mjw2022
Copy link

mjw2022 commented Oct 1, 2024

Was there a fix for this error, as I upgraded ver 1.7.27 today and have the same issue? Thanks

I was able overcome the issue by removing IsNeedRestrictedDataToken = true BUT then get the address by using GetOrderAddress

OrderAddress OrderAddress = amazonConnection.Orders.GetOrderAddress(order.AmazonOrderId);

@CarlosAdrianM
Copy link

Has this bug been fixed? I'm stuck on version 1.7.9, unable to update to a higher version because as soon as I do, this problem appears again.

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

5 participants