dirkgroenen / pinterest-api-php

A PHP wrapper for the official Pinterest API. :pushpin:

Home Page:https://developers.pinterest.com/docs/getting-started/introduction/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Updated getOauthToken

zigstum opened this issue · comments

Pinterest have finally decided on the oauth access token behaviour - the only thing that needs adding to the getOauthToken function in PinterestOauth.php is "timesatmp" => time(),:

public function getOAuthToken($code)
    {
        // Build data array
        $data = array(
            "grant_type"    => "authorization_code",
            "client_id"     => $this->client_id,
            "client_secret" => $this->client_secret,
            "timestamp"     => time(),
            "code"          => $code
        );

        // Perform post request
        $response = $this->request->post("oauth/token", $data);

        return $response;
    }

I can't seem to find any of this in their docs. Can you share your source?