PHP code example of rugaard / oauth2-netatmo

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

    

rugaard / oauth2-netatmo example snippets


$provider = new \Rugaard\OAuth2\Client\Netatmo\Provider\Netatmo([
    'clientId'          => '{netatmo-client-id}',
    'clientSecret'      => '{netatmo-client-secret}',
    'redirectUri'       => 'https://example.com/callback-url'
]);

// Authorize with default scopes.
$url = $provider->getAuthorizationUrl();

// Authorize with other scopes.
$url = $provider->getAuthorizationUrl([
    'scope' => ['read_scope', 'write_scope']
]);