PHPackages                             linkstreet/box-sdk - 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. linkstreet/box-sdk

ActiveSdk[API Development](/categories/api)

linkstreet/box-sdk
==================

v2 Box sdk for php

v0.4.0(3y ago)121.3k6[1 issues](https://github.com/linkstreet/box-sdk/issues)MITPHPCI passing

Since Dec 19Pushed 3y ago4 watchersCompare

[ Source](https://github.com/linkstreet/box-sdk)[ Packagist](https://packagist.org/packages/linkstreet/box-sdk)[ RSS](/packages/linkstreet-box-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (6)Versions (17)Used By (0)

Box Api v2.0 SDK under development.
-----------------------------------

[](#box-api-v20-sdk-under-development)

So far this SDK has only machine to machine authentication mechanism and the following functionality

#### Folders

[](#folders)

1. Get folder info
2. Get folder items
3. Create folder
4. Delete folder
5. Get trashed items
6. Destroy trashed folder
7. Restore the trashed folder

#### Files

[](#files)

1. Upload file
2. Upload Pre flight - This API is used to check if the metadata supplied is valid or not.
3. Get embed URL
4. Delete a file (soft delete - Moves to trash)
5. Destroy trashed file
6. Restore the trashed file

### Usage

[](#usage)

```
use Linkstreet\Box\Box;
use Linkstreet\Box\Enums\SubscriptionType;

$box_sdk = new Box(['client_id' => "", "client_secret" => ""]);

$app_auth_info = [
    "key_id" => "key id from box app",
    "private_key" => "path to private key",
    "pass_phrase" => "passphrase", // Can be empty
    "subscription_type" => SubscriptionType::ENTERPRISE or SubscriptionType::USER,
    "id" => "enterprise id or user id"
];

// Authenticates with box server and returns app_auth instance.
// Throws `GuzzleHttp\Exception\ClientException` on failure
$app_auth_instance = $box_sdk->getAppAuthClient($app_auth_info);
```

#### Folder Service

[](#folder-service)

1. To get the service

    ```
    $folder_service = $app_auth_instance->getFolderService();
    ```
2. Methods available in `$folder_service`

    ```
    1. getFolderInfo($folder_id); // Defaults to root folder (id = 0)
    2. getFolderItems($folder_id = 0, $fields = [], $limit = 100, $offset = 0); // Defaults to root folder (id = 0)
    3. create($folder_name, $parent_folder_id = 0)
    4. delete($folder_id, $recursive = false, $e_tag = null)
    5. getTrashedItems()
    6. destroyTrashedFolder($folder_id)
    7. restore($trashed_folder_id, $new_name = null, $parent_folder_id = null)

    ```

#### File Service

[](#file-service)

1. To get the service

    ```
    $file_service = $app_auth_instance->getFileService();
    ```
2. Methods available in `$file_service`

    ```
    1. uploadPreFlight($file_path = "", $folder_id = 0, $filename = null); // If filename is null, file name will be derived from actual file name.
    2. upload($file_path = "", $folder_id = 0, $filename = null); // If filename is null, file name will be derived from actual file name.
    3. getEmbedUrl($file_id)
    4. delete($file_id)
    5. destroyTrashedFile($file_id)
    6. restore($trashed_file_id, $new_name = null, $parent_folder_id = null)

    ```

##### NOTE:

[](#note)

1. All APIs return `\GuzzleHttp\Psr7\Response` (to get the body use `$response->getBody()->getContents()`. Refer [Guzzle HTTP Messages](http://docs.guzzlephp.org/en/latest/psr7.html#responses)) except `getEmbedUrl($file_id)` which returns string.
2. Guzzle related exceptions and its documentation can be found in [Guzzle Docs](http://docs.guzzlephp.org/en/latest/quickstart.html#exceptions)

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance18

Infrequent updates — may be unmaintained

Popularity26

Limited adoption so far

Community18

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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 ~281 days

Recently: every ~552 days

Total

9

Last Release

1177d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/48fdc9bb049dd4773db00fff2d64dc981ad08fc1e9631a166741ac4c11fcac91?d=identicon)[talk2cerlin](/maintainers/talk2cerlin)

---

Top Contributors

[![talk2cerlin](https://avatars.githubusercontent.com/u/3783401?v=4)](https://github.com/talk2cerlin "talk2cerlin (4 commits)")[![meyyappanv](https://avatars.githubusercontent.com/u/17023819?v=4)](https://github.com/meyyappanv "meyyappanv (2 commits)")[![Naveen1895](https://avatars.githubusercontent.com/u/40588899?v=4)](https://github.com/Naveen1895 "Naveen1895 (2 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (1 commits)")[![Oreolek](https://avatars.githubusercontent.com/u/308627?v=4)](https://github.com/Oreolek "Oreolek (1 commits)")[![jpcaparas](https://avatars.githubusercontent.com/u/2406808?v=4)](https://github.com/jpcaparas "jpcaparas (1 commits)")[![vigneshgurusamy](https://avatars.githubusercontent.com/u/6076800?v=4)](https://github.com/vigneshgurusamy "vigneshgurusamy (1 commits)")

---

Tags

box-sdksdk

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/linkstreet-box-sdk/health.svg)

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

###  Alternatives

[sylius/sylius

E-Commerce platform for PHP, based on Symfony framework.

8.4k5.6M648](/packages/sylius-sylius)[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)

PHPackages © 2026

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