'code': 'Unauthorized' #69
Unanswered
ryankirkland
asked this question in
FAQ
Replies: 2 comments 2 replies
-
|
Hi, I have the same issue, but when I try on postman I receive the data correctly. Any help? thanks |
Beta Was this translation helpful? Give feedback.
2 replies
-
|
Hi @ryankirkland, |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I searched through the other threads covering this and nothing seems to be helping. I've followed the Selling Partner API official documentation for setting up the IAM user, policy, and role, as well as setting up STS.
I've confirmed I am using the correct ID and Secret for the LWA fields and am using the AWS access and secret keys that are tied to the IAM user I created through the SP API docs. I am using the IAM Role ARN rather than the IAM user ARN per documentation recommendation.
I have all boxes checked under Roles in the App registration. I'm feeling at a loss for what else could possibly be wrong here. I am in the US region. My specific error message is:
[{'message': 'Access to requested resource is denied.', 'code': 'Unauthorized', 'details': ''}]
It says unauthorized, but I've generated my refresh token after selecting Authorize in Developer Central. Any guidance would be awesome - I am just trying to run the base call to the Orders API.
# orders API try: res = Orders().get_orders(CreatedAfter=(datetime.utcnow() - timedelta(days=7)).isoformat()) print(res.payload) # json data except SellingApiException as ex: print(ex)I was able to resolve this by just starting over with fresh IAM setup and registering a new client. I will update with the final reason why it was not working as soon as I figure it out myself in the hopes of preventing others from hitting the same thing!
I will say - remember to register your app with the IAM Role ARN, not the IAM User ARN (though I was doing that in the first place, just felt that wasn't abundantly clear). Also, getting your refresh token is a function of Authorizing the app in Developer Central - something else I felt wasn't immediately clear and will hopefully save someone a couple minutes.
Thanks for putting this wrapper together though - loving it so far!
Beta Was this translation helpful? Give feedback.
All reactions