PHPackages                             spectrumvoip/netsapiensclient - 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. spectrumvoip/netsapiensclient

ActiveLibrary[API Development](/categories/api)

spectrumvoip/netsapiensclient
=============================

Simple cURL based PHP client for NetSapiens API

0.0.3(1y ago)0301[1 issues](https://github.com/spectrumvoip/NetSapiens-PHP-Client/issues)MITPHPPHP &gt;=5.6 &lt;=8.2.6

Since May 28Pushed 1y ago2 watchersCompare

[ Source](https://github.com/spectrumvoip/NetSapiens-PHP-Client)[ Packagist](https://packagist.org/packages/spectrumvoip/netsapiensclient)[ RSS](/packages/spectrumvoip-netsapiensclient/feed)WikiDiscussions master Synced yesterday

READMEChangelog (3)DependenciesVersions (4)Used By (0)

NetSapiens PHP Client Documentation
===================================

[](#netsapiens-php-client-documentation)

Maintenance Mode Notice
-----------------------

[](#maintenance-mode-notice)

This repository is now in maintenance mode as the API has been upgraded to version 2. All future development efforts are focused on the v2 client, and support for v1 will be discontinued.

- If you're using the v1 API, we recommend migrating to the [v2 client](https://github.com/spectrumvoip/netsapiens-openapi-php).

Thank you for your understanding.

About
-----

[](#about)

This PHP client is designed to interact with the NetSapiens V1 API. It provides a convenient way to authenticate and make API calls to NetSapiens services.

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

[](#installation)

To install the NetSapiens PHP Client, use Composer:

```
composer require spectrumvoip/netsapiensclient
```

Basic Usage
-----------

[](#basic-usage)

### Initialization

[](#initialization)

First, include the Composer autoloader in your PHP script:

```
require 'vendor/autoload.php';
```

Then, create an instance of the NetSapiensClient:

```
$nsclient = new \spectrumvoip\NetSapiensClient\NetSapiensClient('your-hostname.com');
```

### Authentication

[](#authentication)

To authenticate with the NetSapiens API:

```
$nsclient->login($clientId, $clientSecret, $username, $password);
```

Replace `$clientId`, `$clientSecret`, `$username`, and `$password` with your actual credentials.

### Making API Calls

[](#making-api-calls)

#### GET Request Example

[](#get-request-example)

Here's an example of how to count the number of domains:

```
$params = [
    'format' => 'json',
    'object' => 'domain',
    'action' => 'count',
    'domain' => '*'
];

try {
    $response = $nsclient->ns_api_get($params);
    echo "Number of domains: " . $response['total'];
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

#### POST Request Example

[](#post-request-example)

To make a POST request:

```
$params = [
    'format' => 'json',
    'object' => 'user',
    'action' => 'create',
    // Add other necessary parameters
];

try {
    $response = $nsclient->ns_api_post($params);
    echo "User created successfully";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
```

Advanced Features
-----------------

[](#advanced-features)

### Token Refresh

[](#token-refresh)

The client automatically refreshes the access token when it's close to expiration. You don't need to manually refresh the token in most cases.

### Masquerading

[](#masquerading)

To masquerade as another user:

```
$masqueradeResponse = $nsclient->masquerade_token($uid, $accessToken);
```

Replace `$uid` with the user ID you want to masquerade as, and `$accessToken` with a valid access token.

Error Handling
--------------

[](#error-handling)

The client throws exceptions for API errors and connection issues. Always wrap your API calls in try-catch blocks to handle potential errors gracefully.

API Reference
-------------

[](#api-reference)

For a complete list of available API methods and their parameters, please refer to the NetSapiens API documentation.

Contributing
------------

[](#contributing)

If you find any issues or have suggestions for improvements, please open an issue or submit a pull request on the GitHub repository.

License
-------

[](#license)

This project is licensed under the MIT License.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance35

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity45

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 88% 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 ~54 days

Total

3

Last Release

657d ago

PHP version history (3 changes)0.0.1PHP &gt;=5.6 &lt;8.0

0.0.2PHP &gt;=5.6 &lt;=8.2

0.0.3PHP &gt;=5.6 &lt;=8.2.6

### Community

Maintainers

![](https://www.gravatar.com/avatar/124f1bc600647175557176ad52de95397aa5d1ee850f1884c11ebb7a749d968f?d=identicon)[spectrumvoip-stefano](/maintainers/spectrumvoip-stefano)

---

Top Contributors

[![spectrumvoip-stefano](https://avatars.githubusercontent.com/u/32852146?v=4)](https://github.com/spectrumvoip-stefano "spectrumvoip-stefano (22 commits)")[![sswafford-spectrumvoip](https://avatars.githubusercontent.com/u/161805988?v=4)](https://github.com/sswafford-spectrumvoip "sswafford-spectrumvoip (3 commits)")

### Embed Badge

![Health badge](/badges/spectrumvoip-netsapiensclient/health.svg)

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

###  Alternatives

[exsyst/swagger

A php library to manipulate Swagger specifications

35916.4M7](/packages/exsyst-swagger)[hubspot/api-client

Hubspot API client

24016.2M20](/packages/hubspot-api-client)[pocketmine/bedrock-protocol

An implementation of the Minecraft: Bedrock Edition protocol in PHP

172445.0k14](/packages/pocketmine-bedrock-protocol)[botman/driver-telegram

Telegram driver for BotMan

93459.5k6](/packages/botman-driver-telegram)

PHPackages © 2026

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