1. Go to this page and download the library: Download benkle/deviantart 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/ */
// Must return an instance of \League\OAuth2\Client\Token\AccessToken or null
$accessToken = PROCURE_ACCESS_TOKEN();
use \Benkle\Deviantart\Api;
$api = new Api($provider, $accessToken);
use \Benkle\Deviantart\Exceptions\UnauthorizedException;
try {
$scopes = [Api::SCOPE_BROWSE];
$api->authorize($scopes);
// authorize() will refresh the token, if necessary, so you might want to write it back to storage.
// You can access it via $api->getAccessToken()
} catch (UnauthorizedException $e) {
// Here you can handle the initial user input for authorization.
// The exception message has been replaced with the URL you need to call, so you can get it easily like this:
$url = "$e";
}