GithubHelp home page GithubHelp logo

Comments (6)

RUDIWER avatar RUDIWER commented on August 17, 2024

Anyone knows how to fix this ???

from selling-partner-api.

jlevers avatar jlevers commented on August 17, 2024

For now, just pass any value as the lwaRefreshToken configuration parameter -- shouldn't matter what the value is. I'm working on a fix for this, but it won't be released for a while.

from selling-partner-api.

chrismeats avatar chrismeats commented on August 17, 2024

@jlevers Thank you for the awesome work on this library!
I seem to be having the same issue here. I am unable to use getAuthorizationCode, I get the following error:

Client error: `POST https://api.amazon.com/auth/o2/token` resulted in a `400 Bad Request` response: {"error_description":"The request has an invalid grant parameter : refresh_token","error":"invalid_grant"}

Below is my code snipet if you have any ideas I appreciate it!

            "lwaClientId" => env('LWA_CLIENT_ID'),
            "lwaClientSecret" => env('LWA_CLIENT_SECRET'),
            "lwaRefreshToken" => "NotNeeded",
            "awsAccessKeyId" => env('AMAZON_ACCESS_KEY_ID'),
            "awsSecretAccessKey" => env('AMAZON_SECRET_ACCESS_KEY'),
            "endpoint" => Endpoint::NA,  // or another endpoint from lib/Endpoints.php
            "roleArn" => env('SPAPI_ROLE_ARN'),
        ]);

        $apiInstance = new AuthorizationApi($config);
        $selling_partner_id = "<SellerId>";
        $developer_id = env('AMAZON_DEVELOPER_ID');
        $mws_auth_token = "<MWS AUTH Token.>";

        try {
            $result = $apiInstance->getAuthorizationCode($selling_partner_id, $developer_id, $mws_auth_token);
            dd($result);
        } catch (Exception $e) {
            echo 'Exception when calling AuthorizationApi->getAuthorizationCode: ', $e->getMessage(), PHP_EOL;
        }

from selling-partner-api.

chrismeats avatar chrismeats commented on August 17, 2024

I also tried with "lwaRefreshToken" => ""
Which gives error:

Client error: `POST https://api.amazon.com/auth/o2/token` resulted in a `400 Bad Request` response: {"error_description":"The request is missing a required parameter : refresh_token","error":"invalid_request"}

from selling-partner-api.

jlevers avatar jlevers commented on August 17, 2024

This should be resolved in v3.1.1, which I just released. Sorry that this took a while to get to!

from selling-partner-api.

chrismeats avatar chrismeats commented on August 17, 2024

@jlevers I am still getting these same error messages on the newest release 4.0.2
if I leave lwaRefreshToken blank I get
{"error_description":"The request is missing a required parameter : refresh_token","error":"invalid_request"}
If I remove lwaRefreshToken from my Configuration then I get
lwaRefreshToken must be specified when calling non-grantless API operations
Here is my config I am using:

$config = new Configuration([
            "lwaClientId"        => env('LWA_CLIENT_ID'),
            "lwaClientSecret"    => env('LWA_CLIENT_SECRET'),
//            "lwaRefreshToken"    => '',
            "awsAccessKeyId"     => env('AMAZON_ACCESS_KEY_ID'),
            "awsSecretAccessKey" => env('AMAZON_SECRET_ACCESS_KEY'),
            "endpoint"           => Endpoint::NA,  // or another endpoint from lib/Endpoints.php
            "roleArn"            => env('SPAPI_ROLE_ARN'),
            "accessToken"        => null,
        ]);

What am I missing here?
Any help is GREATLY appreciated!

from selling-partner-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.