dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:
https://developers.pinterest.com/docs/getting-started/introduction/
Apache License 2.0
173 stars 76 forks source link

Invalid grant response when call getauthorizetoken #4

Closed cbuystore closed 8 years ago

cbuystore commented 9 years ago

you can fix this issue by replace getLoginUrl method to this in file vendor\dirkgroenen\pinterest-api-php\src\Pinterest\Auth\PinterestOAuth.php

public function getLoginUrl( $redirect_uri, $scopes = array("read_public") )
    {
        $queryparams = array(
            "response_type"     => "code",
            "redirect_uri"      => $redirect_uri,
            "client_id"         => $this->client_id,
            "client_secret"     => $this->client_secret,
            "scope"             => implode(",", $scopes),
            "state"             => $this->state
        );

        // Build url and return it
        return sprintf( "%s?%s", self::AUTH_HOST, http_build_query($queryparams) );
    }
Behinder commented 7 years ago

Error still persist when requesting token...