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

v4.0.0(2mo ago)029MITPHPPHP &gt;=8.3

Since Sep 19Pushed 2mo 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 today

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

UISP
====

[](#uisp)

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.

---

TOC
---

[](#toc)

- [Requirements](#Requirements)
- [Installation](#Installation)
- [Configuration](#Configuration)
    - [Environment Variable Configuration](#Environment-Variable-Configuration)
    - [Instantiation Configuration](#Instantiation-Configuration)
- [Usage](#Usage)
    - [Concepts](#Concepts)
    - [Output](#Output)
    - [Instantiation](#Instantiation)
- [Method Calls](#Method-Calls)
    - [GET](#GET)
    - [POST](#POST)
    - [PUT](#PUT)
    - [PATCH](#PATCH)
    - [DELETE](#DELETE)
    - [REQUEST](#REQUEST)
    - [DATA](#DATA)
- [Fluent Interface](#Fluent-Interface)

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 connectionfalse---

Usage
-----

[](#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 HTTP body. Not used for GET or DELETE.
- query - Path and query parameters. Any property names that match variable tokens in your path will be removed and inserted into your path name. See GET example below.

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.

```
// {id} will be replaced with 6c2f7697-8c5c-43df-9873-d8819d76a2d2
$output = $client->get(
    endpoint: '/devices/{id}',
       query: [ 'id' => '6c2f7697-8c5c-43df-9873-d8819d76a2d2']
);
```

### 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', 'id' => '6c2f7697-8c5c-43df-9873-d8819d76a2d2' ]
);
```

### PATCH

[](#patch)

Update data.

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

### DELETE

[](#delete)

Delete data.

```
$output = $client->delete(
    endpoint: '/devices/{id}',
      query: [ 'id' => '6c2f7697-8c5c-43df-9873-d8819d76a2d2']
);
```

### 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}',
       query: [ 'id' => '6c2f7697-8c5c-43df-9873-d8819d76a2d2'],
      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}',
       query: [ 'id' => '6c2f7697-8c5c-43df-9873-d8819d76a2d2'],
      method: 'GET'
);
```

---

Fluent Interface
----------------

[](#fluent-interface)

Another means of making API calls is using the Fluent/Chaining interface. Instead of providing an endpoint string, you can build an endpoint with functions.

The last function of your call will be the HTTP method which will take the same arguments as running it directly, only without the endpoint string.

Any endpoint segments using dashes can be specified using camel case.

### Example

[](#example)

```
$output = $client->airlink()->proxy()->airlink-be()->get();
```

Variable path parameters can be provided using the param() function. Notice the camel case to replicate "mac-table-refresh".

```
$output = $client->deviced->param(123)->macTableRefresh()->get();
```

###  Health Score

44

—

FairBetter than 90% of packages

Maintenance86

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity63

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

Recently: every ~28 days

Total

15

Last Release

67d ago

Major Versions

1.2 → 2.02025-11-19

2.4 → v3.0.02026-03-24

v3.1.1 → v4.0.02026-04-27

### 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 (5 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

[statamic/cms

The Statamic CMS Core Package

4.8k3.6M986](/packages/statamic-cms)[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3741.3M47](/packages/tencentcloud-tencentcloud-sdk-php)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[avalara/avataxclient

Client library for Avalara's AvaTax suite of business tax calculation and processing services. Uses the REST v2 API.

528.5M7](/packages/avalara-avataxclient)[eslazarev/wildberries-sdk

Wildberries OpenAPI clients (generated).

273.0k](/packages/eslazarev-wildberries-sdk)[files.com/files-php-sdk

Files.com PHP SDK

2481.1k](/packages/filescom-files-php-sdk)

PHPackages © 2026

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