PHP code example of robindeschepper / phpbox

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

    

robindeschepper / phpbox example snippets



use PhpBox\Box;
use PhpBox\Config\JsonConfig;

$config = new JsonConfig("path/to/box_config.json");
$box = new Box($config);

$folder = $box->Folder->create("0", "Bobs Burgers Fan Theories"); // Creates a folder. Parameters: 1) Parent id/object 2) name.
$myFile = $box->File->request("123456789", ["trashed_at","modified_at"]); // Request file object with 2 extra fields trashed_at & modified_at

$oldToken = $box->getAccessToken();
$folder = "0"; // Root folder
$scope = ["root_readonly"];
$readonly_token = $box->requestExchangeToken($scope, $folder, $oldToken);