PHP code example of stevenmaguire / oauth2-yelp
1. Go to this page and download the library: Download stevenmaguire/oauth2-yelp library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
stevenmaguire / oauth2-yelp example snippets
$provider = new Stevenmaguire\OAuth2\Client\Provider\Yelp([
'clientId' => '{yelp-client-id}',
'clientSecret' => '{yelp-client-secret}'
]);
try {
// Try to get an access token using the client credentials grant.
$accessToken = $provider->getAccessToken('client_credentials');
} catch (\League\OAuth2\Client\Provider\Exception\IdentityProviderException $e) {
// Failed to get the access token
exit($e->getMessage());
}