Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

403 Unauthorized error #48

Open
tarekrahme opened this issue Mar 26, 2023 · 1 comment
Open

403 Unauthorized error #48

tarekrahme opened this issue Mar 26, 2023 · 1 comment

Comments

@tarekrahme
Copy link

tarekrahme commented Mar 26, 2023

Hello

I am facing an issue with this code

credentials = {
      refresh_token: ENV['AWS_REFRESH_TOKEN'],
      client_id: ENV['AWS_CLIENT_ID'],
      client_secret: ENV['AWS_CLIENT_SECRET'],
      aws_access_key_id: ENV['AWS_ACCESS_KEY_ID'],
      aws_secret_access_key: ENV['AWS_SECRET_ACCESS_KEY'],
      region: 'na', 
    }

# get the orders
client = MuffinMan::Orders::V0.new(credentials, sandbox=true)
response = client.get_orders([ENV['AWS_MARKETPLACE_ID']])
pp JSON.parse(response.body)

The 403 error: (notice the first successful OAuth call)

 ETHON: performed EASY effective_url=https://api.amazon.com/auth/o2/token response_code=200 return_code=ok total_time=0.148155
┃ ETHON: performed EASY effective_url=https://sandbox.sellingpartnerapi-na.amazon.com/orders/v0/orders?MarketplaceIds%5B0%5D=ATVPDKIKX0DER response_code=403 return_code=ok total_time=0.555431
┃ {"errors"=>
┃   [{"message"=>"Access to requested resource is denied.",
┃     "code"=>"Unauthorized",
┃     "details"=>""}]}

I would highly appreciate any help or guidance, thanks a lot in advance!

@gavinritchie
Copy link
Contributor

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

No branches or pull requests

2 participants