承接 ocolin/uisp 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

ocolin/uisp

最新稳定版本:2.4

Composer 安装命令:

composer require ocolin/uisp

包简介

Basic UISP REST client

README 文档

README

Description

This is a basic REST client for a UISP server. Version 2 is not compatible with version 1.

This was designed with the mindset of copy/pasting from the API docs into your code. Copy/past the path from the docs, create simply arrays with parameters from the docs with your own values in them. No worrying about the HTTP or credentials work.

Usage

Environment variables

You can specify parameters in the constructor, but if any are left out, these environment variables will be used instead.

UISP_API_TOKEN - Authentication token for API

UISP_API_URL - URL of API server.

Instantiate

Create an instance of the UISP object.

$uisp = new Ocolin\UISP\Client();

Parameters

$host: Name of the UISP host server. If null, will use .env field.

$token: Authentication token for server. If null, will use .env field.

$timeout: HTTP Timeout. Defaults to 20 seconds.

$verify: Verify SSL credentials. Defaults to off.

Making a call

$output = $uisp->call( 
     path: '/devices/airmaxes/{id}/config/wireless',
    query: [
        'id' => 'f700f200-f27f-442b-b086-c6ea128953b7',
        'withStations' => 'true'
    ] 
);

This returns ONLY the HTTP body from the API server.

Parameters

$path: REQUIRED - Endpoint call path, including named parameters.

$query: Array/object of parameters name/values to use for URI path or body.

$method: HTTP method. Defaults to GET.

$body: Array/object of parameters for PUT/POST/PATCH HTTP body.

Making a full call.

This will return an object with 4 properties:

  • status - HTTP status code (200, 400, etc)
  • statusMessage - HTTP status message (OK, Bad Request, etc)
  • headers - HTTP response headers
  • body - HTTP response body
$output = $uisp->full(
      path: '/sites',
    method: 'POST',
      body: [
        'name' => 'Test Site',
    ]   
); 

统计信息

  • 总下载量: 14
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-04-30