DirkGroenen\Pinterest\Auth\PinterestOAuth::getOAuthToken PHP Method

getOAuthToken() public method

Change the code for an access_token
public getOAuthToken ( string $code ) : DirkGroenen\Pinterest\Transport\Response
$code string
return DirkGroenen\Pinterest\Transport\Response
    public function getOAuthToken($code)
    {
        // Build data array
        $data = array("grant_type" => "authorization_code", "client_id" => $this->client_id, "client_secret" => $this->client_secret, "code" => $code);
        // Perform post request
        $response = $this->request->post("oauth/token", $data);
        return $response;
    }