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
612 stars 739 forks source link

Unauthorized & Access to requested resource is denied with no details. Is this due to Role settings? #1167

Closed rashearth closed 2 years ago

rashearth commented 3 years ago

Hi , I am using the selling partner-api to get the catalog information for each ASIN.

Here, i have done all the works written in this document, but still having these issues. Please kindly let us know what is this cause, i have being working for 2 weeks finding the solution for this...

◆Problem: All the work is done, but fetching the below content will output with errror.

Fetch content↓ 'https://sellingpartnerapi-na.amazon.com/fba/inbound/v0/shipments/shipmentId1/preorder/confirm?MarketplaceId=ATVPDKIKX0DER&NeedByDate=2020-10-10'

Output↓ { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ] }

I have set all the permissiion guidelines, signatures done perfectly.

◆Hypothesis: As i have checked through many of the similar issues in github, i think that somehow the application settings in the amazon seller central have ony 3 roles, and dont have any roles checking for catalog information. What did i do wrong? i also added Marketplace policy to the ARN user role, but nothing changed.

スクリーンショット 2021-03-27 12 19 54 スクリーンショット 2021-03-27 12 19 37
Mitalee commented 3 years ago

Had the same issue and the amazon team was gracious to help me out.

  1. Check that the IAM ARN in the draft app has the user ARN (instead of the role ARN).
  2. In the IAM console, these steps are crucial - https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md#step-3-create-an-iam-policy. The policy should be SellingPartnerAPI as per step 6 (You can create it as per the instructions or simply add it to the user (not the role) from the list of policies.)

Worked like a charm post these changes.

stefnats commented 3 years ago

@Mitalee and additionally, it has to be attached as a manged policy. That solved it for me.

rashearth commented 3 years ago

@Mitalee ,@stefnats

Thank you very much for the support, But still having the same issues even I had re-tried the below progress with your comments worked. https://github.com/amzn/selling-partner-api-docs/blob/main/guides/developer-guide/SellingPartnerApiDeveloperGuide.md#registering-your-selling-partner-api-application

Output↓ { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ] }

I was wondering, is these permission the right one to fetch the marketplace I also used this endpont too, but still same output https://sellingpartnerapi-na.amazon.com/catalog/v0/categories?MarketplaceId=ATVPDKIKX0DER Im totally confused on this error...

スクリーンショット 2021-03-31 23 49 47
Mitalee commented 3 years ago

Isn't catalogue part of Product Listing? Just assign all the roles to the draft app and try it out?

rashearth commented 3 years ago

Ya, actually i assinged all the 3 roles that is written, but have the similar error .

stefnats commented 3 years ago

Could you please post the details of your requests including all sent headers & params as well as the complete HTTP Result?

diegocvazquez commented 3 years ago

Hi there, I am strugling with this issue too. Must be the application be approved by amazon before starting to use it?.

I am able to get the tockens, but I cannot make any call, I am allways getting { "errors": [ { "message": "Access to requested resource is denied.", "code": "Unauthorized", "details": "" } ] }

I have used the Rol ARN in one appliation and the user ARN in the second appliction to test but without results.

image

Any help will be much appreciated! rergards, Diego

github-actions[bot] commented 2 years ago

This is a very old issue that is probably not getting as much attention as it deserves. We encourage you to check if this is still an issue after the latest release and if you find that this is still a problem, please feel free to open a new issue and make a reference to this one.