Skip to content

403 Unauthorized error #48

Description

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions