PHP code example of richardhj / oauth2-newsletter2go

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

    

richardhj / oauth2-newsletter2go example snippets


$provider = new Richardhj\Newsletter2Go\OAuth2\Client\Provider\Newsletter2Go([
    'authKey' => $authKey,
]);

$accessToken = $provider->getAccessToken(
    'https://nl2go.com/jwt',
    [
        'username' => $username,
        'password' => $password,
    ]
);

$accessToken = $provider->getAccessToken(
    'https://nl2go.com/jwt_refresh',
    [
        'refresh_token' => $accessToken->getRefreshToken()
    ]
);