build() ->setBaseUri('https://'.$conf['instance']); $code=$argv[1]; // obtain a token using this code: $token = $client->methods()->oauth()->token( 'authorization_code', // NB: different from app token call above! $code, $conf['client_id'], $conf['client_secret'], 'https://admin.piaille.fr/callback.php', null, 'read write admin:read admin:write', ); echo "TOKEN: ".$token->access_token."
\n";