PHPackages                             colq2/phpipam-client - 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. colq2/phpipam-client

ArchivedLibary[API Development](/categories/api)

colq2/phpipam-client
====================

A API Client for phpIPAM written in PHP

v1.0.1(8y ago)24082[1 issues](https://github.com/colq2/phpIPAMClient/issues)MITPHPPHP ^7.0

Since Jan 10Pushed 7y agoCompare

[ Source](https://github.com/colq2/phpIPAMClient)[ Packagist](https://packagist.org/packages/colq2/phpipam-client)[ RSS](/packages/colq2-phpipam-client/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (2)Dependencies (4)Versions (4)Used By (0)

phpIPAMClient
=============

[](#phpipamclient)

phpIPAM is an open-source IP address management web application which can be controlled by an api. This is an api client for php which can be used to control phpIPAM.

Learn more:

- [phpIPAM Homepage](https://phpipam.net/)
- [phpIPAM Source](https://github.com/phpipam/phpipam)
- [phpIPAM API Docs](https://phpipam.net/api/api_documentation/)

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

[](#installation)

You can install this package through composer:

At the moment I suggest to stay at the 1.0.x-dev version:

`composer require colq2/phpipam-client:1.0.x-dev`

cause i always find some small issues and todo's that I'm fixing on this branch.

Else you can go with the current release:

`composer require colq2/phpipam-client`

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

[](#basic-usage)

You can use this client in two ways.

1. Use the controller classes and let the client manage the most things for you
2. Use the call method on the client object

Notice: I only provide secure connections to the server. The API provides two ways to do that:

- SSL
- Own encryption

Read more on [Security](#security)

### Initialize connection

[](#initialize-connection)

`use colq2\PhpIPAMClient;`

`$client = new PhpIPAMClient('1.2.3.4', 'myApp', 'name', 'password', 'apikey');`

or

`use colq2\PhpIPAMClient\Connection\Connection;`

`Connection::initializeConnection('1.2.3.4', 'myApp', 'name', 'password', 'apikey');`

### First Way

[](#first-way)

I will use the sections controller as Example. It's important to understand, that this api ist strong object oriented. This means, that the controllers can be used as objects that represents the objects server side. The objects provides getter and setter for their attributes. And you can set client side objects to the attribute. This client handles to conversion between Object and IDs on it's own!

Import the controller with `use colq2\PhpIPAMClient\Controller\Section;` at the top.

#### Get all sections

[](#get-all-sections)

To get all sections use the getAll method. This return an array with all sections as `colq2\Controller\Section` instances.

`$sections = Section::getAll();`

#### Get section by id or name

[](#get-section-by-id-or-name)

`$section = Section::getByID('1');`

`$section = Section::getByName('name');`

#### Create a section

[](#create-a-section)

You can use the construct or the create method.

With the construct:

`$section = new Section(['params_array']);`

And use the getter and setter:

`$section->setDescription();`

You need to use the patch method to safe it:

`$section->patch();`

#### Patch a section

[](#patch-a-section)

To patch a section use the setter on it or an array to the method. Or both! But the array will override the given attributes.

`$section->setDescription('A cool description!');`

#### Delete a section

[](#delete-a-section)

`$section->delete();`

### Second Way

[](#second-way)

`$response = $client->call('method', 'controller', ['identifier_array'], ['param_array']);`

This will return an instance of `colq2\Connection\Response`. You can access the data using the getData method.

`$data = $response->getData()`

To get the whole response body use the getBody method.

`$body = $response->getBody()`

Learn more on [Response Object](docs/response.md)

Controller
----------

[](#controller)

#### Notice

[](#notice)

This docs are not ready yet. I'm working on it. Read the phpIPAM Api docs. I mapped the request url's to name. For example:

- GET /api/my\_app/subnets/{id}/ =&gt; $subnet = Subnet::getById($id);
- GET /api/my\_app/subnets/{id}/usage/ =&gt; $subnet-&gt;getUsage();
- PATCH /api/my\_app/subnets/{id}/ =&gt; Subnet::patch();

For more detailed information for all methods and controller look at [phpIPAM website](https://phpipam.net) and at the following controller documentation:

- [Sections](docs/section.md)
- [Subnets](docs/subnet.md)
- [Folders](docs/folder.md)
- [VLAN](docs/vlan.md)
- [Address](docs/address.md)
- [L2 Domain](docs/L2Domain.md)
- [VRF](docs/vrf.md)
- [Device](docs/device.md)

Security
--------

[](#security)

The last parameter a of the construct is a value of the following constants:

`use colq2\PhpIPAMClient\Connection\Connection`

- `Connection::SECURITY_METHOD_SSL`
- `Connection::SECURITY_METHOD_CRYPT`
- `Connection::SECURITY_METHOD_BOTH`

I recommend to use the SLL method. For this you need a https connection to your Server!

If you don't have the possibility to use SSL use crypt. You need to provide the API Key from the Backend. Furthermore you need to change one file serverside cause phpipam uses `mcrypt` but this method is deprecated. I am using `openssl`.

[index.php](https://github.com/colq2/phpipam/blob/master/api/index.php)

It is on my repo but i will stay in contact with the developer of phpipam so that we can find together a solution for that.

`$client = new PhpIPAMClient('www.example.com/phpipam', 'myApp','' , '', 'your app key, Connection::SECURITY_METHOD_CRYPT)`

And also if you are paranoid security fanatics (like me) use the `Connection::SECURITY_METHOD_BOTH`

`$client = new PhpIPAMClient('https://www.example.com/phpipam', 'myApp','' , '', 'your app key, Connection::SECURITY_METHOD_BOTH)`

Exceptions
----------

[](#exceptions)

There are two types of Exceptions:

- `PhpIPAMException`

This will be thrown when something went wrong with the api client.

- `PhpIPAMRequestException`

This will be thrown if a request fails. This Exception saves the response so you can lookup the error: `$response = $e->getResponse();`

Read more on [Response Object](docs/response.md)

License
-------

[](#license)

MIT

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance10

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

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

Total

3

Last Release

2837d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/25695283?v=4)[Oliver Wycisk](/maintainers/colq2)[@colq2](https://github.com/colq2)

---

Top Contributors

[![colq2](https://avatars.githubusercontent.com/u/25695283?v=4)](https://github.com/colq2 "colq2 (3 commits)")

---

Tags

api-clientphpphpipamphpapiclientphpipam

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/colq2-phpipam-client/health.svg)

```
[![Health](https://phpackages.com/badges/colq2-phpipam-client/health.svg)](https://phpackages.com/packages/colq2-phpipam-client)
```

###  Alternatives

[openai-php/laravel

OpenAI PHP for Laravel is a supercharged PHP API client that allows you to interact with the Open AI API

3.7k8.8M83](/packages/openai-php-laravel)[resend/resend-php

Resend PHP library.

596.2M35](/packages/resend-resend-php)[kunalvarma05/dropbox-php-sdk

Dropbox PHP API V2 SDK (Unofficial)

3623.1M18](/packages/kunalvarma05-dropbox-php-sdk)[mozex/anthropic-laravel

Laravel integration for the Anthropic API: facade, config publishing, install command, testing fakes, messages, streaming, tool use, thinking, and batches.

72287.1k1](/packages/mozex-anthropic-laravel)[timkley/weaviate-php

A PHP HTTP Client for the Weaviate REST API

3864.4k2](/packages/timkley-weaviate-php)[files.com/files-php-sdk

Files.com PHP SDK

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

PHPackages © 2026

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