PHPackages                             radzserg/box-content - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [API Development](/categories/api)
4. /
5. radzserg/box-content

ActiveSdk[API Development](/categories/api)

radzserg/box-content
====================

Box.com Content API SDK V2.

013PHP

Since Jul 7Pushed 9y agoCompare

[ Source](https://github.com/radzserg/box-content)[ Packagist](https://packagist.org/packages/radzserg/box-content)[ RSS](/packages/radzserg-box-content/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Box.com content API PHP SDK v2
==============================

[](#boxcom-content-api-php-sdk-v2)

**Warning: this is not full and well tested SDK. This is just an example of usages. I don't have much time to implement all API endpoints. I implemented only what I needed. But this could be easily extended. I used box.com platform integration.**

Start from here [box.com docs](https://docs.box.com/docs/getting-started-box-platform)

```
use radzserg\BoxContent\BoxContentException;
use radzserg\BoxContent\Client;

$client = new Client([
    'publicKeyId' => 'public_key',  // Public Key ID generated by Box and provided upon submission of a Public Key. Identifies which Public Key a client is using.
    'enterpriseId' => 'enterprise_id', // enterprise_id for a token specific to an enterprise
    'boxUserId' => 'user_id',  // app user_id for a token specific to an individual app user. https://docs.box.com/docs/app-users#section-2-create-an-app-user
    'privateCertPath' => '/path/to/cert.pem',    // path to your private cert
    'certPassword' => 'password',
    'clientId' => 'client_id',      // app client id
    'secretId' => 'secret_id',      // app secret id
    // next fields are optional

    // specify cache files in order not to sign every requets but save them to cache files
    // tokens will be automatically refreshed when they expire
    'appTokenCachePath' => '/path/to/boxcom_app_token.json',    // path to file where app token will be saved
    'userTokenCachePath' => '/path/to/boxcom_user_token.json',  // path to file where user token will be saved
]);

// first create platform user then we will use this user for other operations
try {
    $platformUser = $client->user->createPlatformUser(['name' => 'John Doe']);
} catch (BoxContentException $e) {
    echo $e->getMessage() . "\n" . $e->getTraceAsString() . "\n\n";
}

// update your content boxUserId with received user id
try {
    $params = [
        'attributes' => json_encode([
            'parent' => ['id' => "0"],  // upload to root user folder
            'name' => 'composer3.json',
        ])
    ];
    $file = $client->document->uploadFile(fopen('../myfile.jpg', 'r'), $params);

    var_dump($file);
} catch (BoxContentException $e) {
    echo $e->getMessage() . "\n" . $e->getTraceAsString() . "\n\n";
}

$content = $client->document->get('73301640961')->thumbnail('png', ['min_height' => 32, 'min_width' => 32]);
echo '';

$document = $client->document->get('73301640961', ['expiring_embed_link']);
$link = $document->getData('expiring_embed_link');
echo isset($link['url']) ? $link['url'] : null;
```

If you need more endpoints - pull requests are welcome :)

###  Health Score

20

—

LowBetter than 13% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/293785?v=4)[Sergey Radzishevskii](/maintainers/radzserg)[@radzserg](https://github.com/radzserg)

---

Top Contributors

[![radzserg](https://avatars.githubusercontent.com/u/293785?v=4)](https://github.com/radzserg "radzserg (10 commits)")

### Embed Badge

![Health badge](/badges/radzserg-box-content/health.svg)

```
[![Health](https://phpackages.com/badges/radzserg-box-content/health.svg)](https://phpackages.com/packages/radzserg-box-content)
```

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35816.3M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24015.5M18](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172437.8k11](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

94452.6k6](/packages/botman-driver-telegram)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
