PHPackages                             robindeschepper/phpbox - 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. robindeschepper/phpbox

AbandonedArchivedLibrary[API Development](/categories/api)

robindeschepper/phpbox
======================

A PHP Box package.

v0.1.1-alpha(7y ago)023GPL-3.0-onlyPHPPHP &gt;=7.0

Since Dec 2Pushed 5y agoCompare

[ Source](https://github.com/Helveg/phpbox)[ Packagist](https://packagist.org/packages/robindeschepper/phpbox)[ RSS](/packages/robindeschepper-phpbox/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

phpbox
======

[](#phpbox)

This project is abandoned, I don't use Box or PHP anymore.

Implementation of several aspects of the Box v2.0 API.

[![Build Status](https://camo.githubusercontent.com/9396f715c01f626aab344aa3929fa0d17d38f816fe6a8c276579f400142c57c7/68747470733a2f2f7472617669732d63692e636f6d2f48656c7665672f706870626f782e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/Helveg/phpbox)

Installation
------------

[](#installation)

Install via `composer require robindeschepper/phpbox`.

Getting Started
---------------

[](#getting-started)

Currently it connects via a Box [JWT](https://developer.box.com/docs/construct-jwt-claim-manually) JSON config file or through setting of the values on the Config object. Accessing your box app is done like this:

```
require_once("vendor/autoload.php");
use PhpBox\Box;
use PhpBox\Config\JsonConfig;

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

This will use your json config file to request an access token via JWT. The token is stored in the PhpBox object and automatically refreshed if it expires.

Model
-----

[](#model)

I have created classes for the following objects in the Box API:

```
Collaboration, CollaborationWhitelistEntry,
     Comment, DevicePinner, Event, File, FileVersion,
     FileVersionRetention, Folder, Group, GroupMembership,
     Item, LegalHold, LegalHoldPolicy, LegalHoldPolicyAssignment,
     Metadata, MetadataCascadePolicy, MetadataTemplate,
     RecentItem, RetentionPolicy, RetentionPolicyAssignment, SharedLink,
     StoragePolicy, StoragePolicyAssignment, Task, TemplateField,
     TermsOfService, User, Webhook, WebLink

```

These objects are populated by analyzing the JSON payload received from Box using Guzzle requests. Each field in the returned JSON object will become a property in the PhpBox object.

### Example of JSON to PhpBox object

[](#example-of-json-to-phpbox-object)

```
{
	"id": "1234",
	"type": "file_version",
	"file": {
		"id": "125",
		"type": "file"
	},
	"version": "2"
}
```

This will become an object of type `PhpBox\Objects\FileVersion` with fields `id`, `type`, `version`and `file` (of type `PhpBox\Objects\File`).

### Managers

[](#managers)

Some of these objects will have a Manager in the PhpBox object that is used to perform the actions described for each object in the Box API reference such as creating, requesting, deleting, updating, or many other actions.

```
$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
```

Similar calls can be made on each of these managers and a detailed explanation will follow when v0.2.1 is released which will focus on implementing core actions shared among all managers such as creating or deleting objects.

Exchange Tokens
---------------

[](#exchange-tokens)

Full access tokens can be exchanged for tokens with limited permissions to pass into less secure or untrusted services or environments (e.g. client-side). See the Box Documentation on [Scopes](https://developer.box.com/docs/scopes) for more information on the scope parameter. If the token parameter is omitted the access token is used. Tokens can only be exchanged for more restrictive ones. If the folder parameter is omitted the root folder of the old token is used.

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

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

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.

###  Release Activity

Cadence

Every ~5 days

Total

2

Last Release

2710d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0698e0178d7ac0059be3b6fb5c69c6fac8060557c7f23dda7425b6c6ad9f2a0d?d=identicon)[RobinDeSchepper](/maintainers/RobinDeSchepper)

---

Top Contributors

[![Helveg](https://avatars.githubusercontent.com/u/28923979?v=4)](https://github.com/Helveg "Helveg (65 commits)")

---

Tags

apiboxlibraryphpwrapper

### Embed Badge

![Health badge](/badges/robindeschepper-phpbox/health.svg)

```
[![Health](https://phpackages.com/badges/robindeschepper-phpbox/health.svg)](https://phpackages.com/packages/robindeschepper-phpbox)
```

###  Alternatives

[get-stream/stream

A PHP client for Stream (https://getstream.io)

1451.3M8](/packages/get-stream-stream)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[agence104/livekit-server-sdk

Server-side SDK for LiveKit.

79189.9k1](/packages/agence104-livekit-server-sdk)[packbackbooks/lti-1p3-tool

A library used for building IMS-certified LTI 1.3 tool providers in PHP.

51438.3k2](/packages/packbackbooks-lti-1p3-tool)[tamara-solution/php-sdk

Tamara PHP Client Library

10259.4k1](/packages/tamara-solution-php-sdk)[revolution/laravel-bluesky

Bluesky(AT Protocol) for Laravel

4317.3k](/packages/revolution-laravel-bluesky)

PHPackages © 2026

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