1. Go to this page and download the library: Download yuudrive/drive-sdk 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/ */
yuudrive / drive-sdk example snippets
// include your composer dependencies
nt_id = "YOUR_CLIENT_ID_HERE";
$client_secret = "YOUR_SECRET_KEY_HERE";
$developer_key = "YOUR_DEV_KEY_HERE";
$redirect_uri = 'http://example.com/callback';
$client = new Client($client_id, $client_secret, $developer_key, $redirect_uri);
// passing access token parameter
$client->profile($access_token);
// OR
$client->setAccessToken($access_token);
$profile = $client->profile()->getResponse();
// attributes:
$profile->getId(); // get User id
$profile->getEmail(); // user email
$profile->getName(); // name
$profile->getPicture(); // profile picture
$client->setAccessToken($access_token);
$files = $client->getFiles()->getResponse();
// only return the file list
$files->showFileOnly();
// only return the folder list
$files->showFolderOnly();
$client->setAccessToken($access_token);
$create_folder = $client->folder($folder_name)->setRole('reader')->setPermissionType('anyone');
// to set folder color
->colorRgb($rgb_code);
// to set folder starred
->starred(true);
//execute instance
$create_folder = $create_folder->create()->getResponse();
print_r($create_folder->data); // to return object response
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.