PHP code example of ahmedd-ibrahim / oauth2

1. Go to this page and download the library: Download ahmedd-ibrahim/oauth2 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/ */

    

ahmedd-ibrahim / oauth2 example snippets




class YourOwnClass extends Oauth
{
    public function __construct(array $requesrParam, $clientConfig = []) {
        parent::__construct($requesrParam, $clientConfig);
        Oauth::$authTokenUrl = 'https://accounts.zoho.com/oauth/v2/token?';
    }
}




     $param = [
                 'client_id' => env('CLIENT_ID'),
                 'client_secret' => env('CLINET_SECRET'),
                 'grant_type' => 'refresh_token',
                 'redirect_uri' => env('REDIRECT_URI'),
                 'currentUserEmail' => env('EMAIL'),
        ];

return (new YourOwnClass($param))->accessToken();