PHP code example of gn-office / directcloud-api

1. Go to this page and download the library: Download gn-office/directcloud-api 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/ */

    

gn-office / directcloud-api example snippets


use GNOffice\DirectCloud\Client;

$client = new Client([$service, $service_key, $code, $id, $password]);
// or
$client = new Client([$service, $service_key, $access_key]);
// or
$client = new Client($access_token);

//create a folder
$client->createFolder($node, $name);

//list a folder
$client->getList($node);

public function v1Request(string $method, string $endpoint, string $requestOption = null, $parameters = [])

public function v2Request(string $method, string $endpoint, string $requestOption, $parameters = [], $extraHeaders = [])

$client->v1Request('/openapp/v1/files/search/'.{$node}, ['keyword' => 'something', 'sort' => '+datetime', 'limit' => 100]);