PHPackages                             ocolin/uisp - 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. ocolin/uisp

ActiveLibrary[API Development](/categories/api)

ocolin/uisp
===========

Basic PHP UISP REST client

v3.0.0(1mo ago)020MITPHPPHP &gt;=8.3

Since Sep 19Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/ocolin/UISP)[ Packagist](https://packagist.org/packages/ocolin/uisp)[ Docs](https://github.com/ocolin/UISP)[ RSS](/packages/ocolin-uisp/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (14)Used By (0)

UISP
====

[](#uisp)

Description
-----------

[](#description)

This UISP plugin is a lightweight PHP HTTP client specifically for Ubiquiti's UISP server.

It is designed so you don't have to worry about setting up or paying attention to any of the HTTP mechanism. All you need is to provide the endpoint, the method, and the data.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.3
- guzzlehttp/guzzle ^7.10
- ocolin/globaltypes ^2.0

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

[](#installation)

```
composer require ocolin/uisp

```

Configuration
-------------

[](#configuration)

### Environment Variable Configuration

[](#environment-variable-configuration)

This plugin was designed to use environment variables for ease of use. You can use .env.example as a template for the variable names:

VariableDescriptionExampleUISP\_API\_TOKENAuthentication token24a1a5eg-dfa9-5679-a51f-b9eg43c65862UISP\_API\_URLServer URI### Instantiation Configuration

[](#instantiation-configuration)

The Client constructor can also take an array of optional information including the server URI and authentication token. Here are the optional configuration settings that can be used:

NameDescriptionDefaultbase\_uriURI to API serverUISP\_API\_URL env vartokenAuthentication token for API serverUISP\_API\_TOKEN env vartimeoutHTTP timeout20 secondsconnect\_timeoutTimeout for connection20 secondsverifyVerify SSL connectionfalseUsage
-----

[](#usage)

### Concepts

[](#concepts)

Here are the arguments you need when making an API call:

- endpoint - Copy/paste the end point from your API docs. Any variables in the endpoint will be replaced with variables of the same name in your parameters.
- method - You specify an HTTP methods. This is either done by choosing the method function name, or specifying the method name depending on which function call is used.
- params - These are the variables that are used in the endpoint path and the HTTP body. Any parameters in the path will be removed from the body and used in the endpoint path.
- query - Some HTTP methods like POST/PUT/PATCH may require HTTP query parameters in addition to the HTTP body. You can specify those query parameters with this argument.

Below you can find examples for each scenario.

### Output

[](#output)

Most methods will output an object with 4 properties:

PropertyDesdcriptionTypestatusHTTP status numeric codeintstatusMessageHTTP text statusstringheadersHTTP response headersstring\[\]bodyAPI response datamixedThe exception to this is the data() function which returns ONLY the HTTP body (See example below).

### Instantiation

[](#instantiation)

#### Using Environment Variables

[](#using-environment-variables)

```
// Manually creating for demonstration
$_ENV['UISP_API_TOKEN'] = 'myauthtoken';
$_ENV['UISP_API_URL']   = 'https://myserver.com/nms/api/v2.1/';

$client = new Ocolin\UISP\Client();
```

#### Setting Options parameters

[](#setting-options-parameters)

```
$options = [
    'base_uri' => 'https://myserver.com/nms/api/v2.1/',
    'token'    => 'myauthtoken',
    'timeout'  => 60
];

$client = new Ocolin\UISP\Client( options: $options );
```

### Method Calls

[](#method-calls)

#### GET

[](#get)

Get data.

```
$output = $client->get(
    endpoint: '/devices/{id}',
      params: [ 'id' => 'mydeviceidgoeshere-andreplacespathid']
);
```

#### POST

[](#post)

Create data.

```
$output = $client->post(
    endpoint: '/sites',
      params: [ 'name' => 'My New Site' ]
);
```

### PUT

[](#put)

Update data.

```
$output = $client->put(
    endpoint: '/sites/{id}',
      params: $site_object, // Object of a site from UISP
       query: [ 'isComposeRequest' => 'true' ]
);
```

### PATCH

[](#patch)

Update data.

```
$output = $client->patch(
    endpoint: '/sites/{id}',
      params: $site_object, // Object of a site from UISP
       query: [ 'isComposeRequest' => 'true' ]
);
```

### DELETE

[](#delete)

Delete data.

```
$output = $client->delete(
    endpoint: '/devices/{id}',
      params: [ 'id' => 'mydeviceidgoeshere-andreplacespathid']
);
```

### REQUEST

[](#request)

Request is a more generic function where you specify the method rather than calling the specific method function.

```
$output = $client->request(
    endpoint: '/devices/{id}',
      params: [ 'id' => 'mydeviceidgoeshere-andreplacespathid'],
      method: 'GET'
);
```

### DATA

[](#data)

Data is much like the request() function, but it only returns the data. This is for situations where you don't need any of the other data and can assume problems based solely on the response body.

```
// Output is mixed data type
$output = $client->data(
    endpoint: '/devices/{id}',
      params: [ 'id' => 'mydeviceidgoeshere-andreplacespathid'],
      method: 'GET'
);
```

###  Health Score

44

—

FairBetter than 92% of packages

Maintenance89

Actively maintained with recent releases

Popularity7

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity62

Established project with proven stability

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

Recently: every ~20 days

Total

12

Last Release

55d ago

Major Versions

1.2 → 2.02025-11-19

2.4 → v3.0.02026-03-24

### Community

Maintainers

![](https://www.gravatar.com/avatar/e97ac0aa452b872ddc3f7f4c56c83852574a27bb74622f8c054d11ca20008fc9?d=identicon)[Ocolin](/maintainers/Ocolin)

---

Top Contributors

[![ocolin](https://avatars.githubusercontent.com/u/8870196?v=4)](https://github.com/ocolin "ocolin (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/ocolin-uisp/health.svg)

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

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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