PHPackages                             crafterlp/active-servers-sdk - 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. crafterlp/active-servers-sdk

ActiveLibrary[API Development](/categories/api)

crafterlp/active-servers-sdk
============================

A simple rest api for the new active-servers customer api

00PHP

Since Mar 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/CrafterLP2007/ActiveServersSDK)[ Packagist](https://packagist.org/packages/crafterlp/active-servers-sdk)[ RSS](/packages/crafterlp-active-servers-sdk/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

ActiveServers-SDK
=================

[](#activeservers-sdk)

 [![](https://camo.githubusercontent.com/c13a42f4f732b0747bd547392dcfe2a7030b346be20d3f68feeef8eae822549e/68747470733a2f2f7777772e6163746976652d736572766572732e636f6d2f696d672f6c6f676f332e706e67)](https://camo.githubusercontent.com/c13a42f4f732b0747bd547392dcfe2a7030b346be20d3f68feeef8eae822549e/68747470733a2f2f7777772e6163746976652d736572766572732e636f6d2f696d672f6c6f676f332e706e67)

This SDK provides functionalities to interact with the ActiveServers API for managing servers and resources.

[![Total Downloads](https://camo.githubusercontent.com/a0d2c8b193fd1f99d15d8cb78606facc04614ba79af803dcc846d6b815aeb804/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f)](https://packagist.org/packages/)[![Latest Stable Version](https://camo.githubusercontent.com/e48a9304ad971de3f7e855225849ffd67e9c17020bb1b535b1170e1c2ef68c20/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f)](https://packagist.org/packages/)[![License](https://camo.githubusercontent.com/6ab466e34054b09756094071bfde5fc3e86ddff0497b7e90291e176777aa2e5d/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f)](https://packagist.org/packages/)

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

[](#installation)

### Install via Composer

[](#install-via-composer)

To use this SDK, you can install it via composer:

```
composer require crafterlp/activeservers-sdk
```

### Getting the API Credentials

[](#getting-the-api-credentials)

At the moment you still have to request an API beta. To do this you have to write an email to support.

Usage
-----

[](#usage)

### Initialization

[](#initialization)

To use the SDK, you need to create a new instance of the `ActiveServers` class and pass the Email and Password as parameters.

```
use CrafterLP\ActiveServersSDK\ActiveServers;

$api = new ActiveServersAPI("your_email@example.com", "your_password");
```

### Example Usage for CPU

[](#example-usage-for-cpu)

The following example shows how to use the SDK to interact with the CPU resource.

```
// Get CPU by ID
$cpu = $api->cpu->getById("1");

//Get CPU by Name
$cpu = $api->cpu->getByName("Intel Core i9-9900K");

// Get all CPUs
$cpus = $api->cpu->getAll();

//Get CPU ID
$cpu->getCpuId();

// Get CPU Name
$cpu->getCpuName();

// Get CPU Price
$cpu->getCpuPrice();

// Get Units left of CPU
$cpu->getUnitsLeft();

// Check if CPU is available
$cpu->isAvailable();
```

### Example Usage for GPU

[](#example-usage-for-gpu)

The following example shows how to use the SDK to interact with the GPU resource.

```
// Get GPU by ID
$gpu = $api->gpu->getById("1");

//Get GPU by Name
$gpu = $api->gpu->getByName("NVIDIA GeForce RTX 2080 Ti");

// Get all GPUs
$gpus = $api->gpu->getAll();

//Get GPU ID
$gpu->getGpuId();

// Get GPU Name
$gpu->getGpuName();

// Get GPU Price
$gpu->getGpuPrice();

// Get Units left of GPU
$gpu->getUnitsLeft();

// Check if GPU is available
$gpu->isAvailable();
```

### Example Usage for RAM

[](#example-usage-for-ram)

The following example shows how to use the SDK to interact with the RAM resource.

```
// Get RAM by ID
$ram = $api->ram->getById("1");

//Get RAM by Name
$ram = $api->ram->getByName("16GB DDR4 RAM");

// Get all RAMs
$rams = $api->ram->getAll();

//Get RAM ID
$ram->getRamId();

// Get RAM Name
$ram->getRamName();

// Get RAM Price
$ram->getRamPrice();

// Get Units left of RAM
$ram->getUnitsLeft();

// Check if RAM is available
$ram->isAvailable();
```

### Example Usage for Disk

[](#example-usage-for-disk)

The following example shows how to use the SDK to interact with the Disk resource.

```
// Get Disk by ID
$disk = $api->disk->getById("1");

// Get all Disks
$disks = $api->disk->getAll();

//Get Disk ID
$disk->getDiskId();

// Get Form Factor
$disk->getDiskFormFactor();

// Get Disk price
$disk->getDiskPrice();

// Get Units left of Disk
$disk->getUnitsLeft();

// Check if Disk is available
$disk->isAvailable();
```

### Example Usage for Uplink

[](#example-usage-for-uplink)

The following example shows how to use the SDK to interact with the Uplink resource.

```
// Get Uplink by ID
$uplink = $api->uplink->getById("1");

// Get all Uplinks
$uplinks = $api->uplink->getAll();

//Get Uplink ID
$uplink->getUplinkId();

// Get Transfer speed
$uplink->getTransferSpeed();

// Get Uplink price
$uplink->getUplinkPrice();

// Get Units left of Uplink
$uplink->getUnitsLeft();

// Check if Uplink is available
$uplink->isAvailable();

// Get data capacities
$uplink->getDataCapacities(); // Returns an array with the data capacities

// Get data capacity
$uplink->getDataCapacities()[0]; // Returns the first data capacity

// Get data capacity label
$uplink->getDataCapacities()[0]->getLabel(); // Returns the label of the first data capacity

// Get data capacity price
$uplink->getDataCapacities()[0]->getPrice(); // Returns the price of the first data capacity
```

### Example Usage for OperatingSystem

[](#example-usage-for-operatingsystem)

The following example shows how to use the SDK to interact with the OperatingSystem resource.

```
// Get OperatingSystem by ID
$os = $api->os->getById("1");

// Get OperatingSystem by Name
$os = $api->os->getByName("CentOs");

// Get all OperatingSystems
$oss = $api->os->getAll();

//Get OperatingSystem ID
$os->getOsId();

// Get OperatingSystem Name
$os->getOsName();

// Get Units left of OperatingSystem
$os->getUnitsLeft();

// Check if OperatingSystem is available
$os->isAvailable();

// Get OperatingSystem versions
$os->getOsVersion();

// Get OperatingSystem with version
$os->getOsVersion()[0]; // Returns the first version

// Get OperatingSystem version
$os->getOsVersion()[0]->getVersion(); // Returns the label of the first version

// Get OperatingSystem version setup price
$os->getOsVersion()[0]->getSetupPrice(); // Returns the price of the first version
```

### Example Usage to create a new Order

[](#example-usage-to-create-a-new-order)

To create a new order, you can use the `OrderBuilder` class to create a new order.

```
use CrafterLP\ActiveServersSDK\OrderBuilder;

$order = (new OrderBuilder())
            ->setCpu(1, 1
            ->addDisk(1, 1)
            ->setRam(1, 1)
            ->setGpu(1, 1)
            ->setUplink(1, 1, "Fair Use 50TB")
            ->setOperatingSystem(1, 1, "CentOS 7")
            ->setCustomerEmail("customer@mail.de")
            ->setDiscountLevel("first_server")
            ->setContractType("dedicated_server")
            ->setContractDuration(1)
            ->setPaymentMethod("bank_transfer")
            ->setComments("My first server!")
            ->setCustomerNo("123")
            ->build(); // Don't forget to build the order

$api->order->createOrder($order);
```

### Example Usage to get an Order

[](#example-usage-to-get-an-order)

To get an order, you can use the `OrderBuilder` class to create a new order.

```
$order = $api->order->getById("1");

// Get Ordered ID
$order->getOrderId();

// Get Ordered CPU
$order->getCpu();

// Get Ordered Disks
$order->getDisks();

// Get Ordered RAM
$order->getRam();

// Get Ordered GPU
$order->getGpu();

// Get Ordered Operating System
$order->getOs();

// Get Ordered Uplink
$order->getUplink();

// Get Setup Cost
$order->getSetupCost();

// Get Monthly Cost
$order->getMonthlyCost();

// Get Customer Email
$order->getCustomerEmail();

// Get Discount Level
$order->getDiscountLevel();

// Get Contract Type
$order->getContractType();

// Get Contract Duration
$order->getContractDuration();

// Get Payment Method
$order->getPaymentMethod();

// Get Status
$order->getStatus();

// Get Comments
$order->getComments();

// Get Customer No
$order->getCustomerNo();

// Get Created At
$order->getCreatedTimestamp();

// Get Updated At
$order->getModifiedTimestamp();
```

Extra Methods
-------------

[](#extra-methods)

Use the `getRaw()` function in each manager to get the raw response from the API.

```
// Gets all CPUs as raw response/array
$cpu = $api->cpu->getRaw();
```

Licence
-------

[](#licence)

The ActiveServers-SDK is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).

###  Health Score

12

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity19

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/0ee72a4abaac39434ed00564e24b62ac2929ff2472ad59b70c2e180cd35a0bcf?d=identicon)[CrafterLP\_2K7](/maintainers/CrafterLP_2K7)

---

Top Contributors

[![CrafterLP2007](https://avatars.githubusercontent.com/u/100671668?v=4)](https://github.com/CrafterLP2007 "CrafterLP2007 (5 commits)")

---

Tags

active-serversapicomposerphpsdksdk-php

### Embed Badge

![Health badge](/badges/crafterlp-active-servers-sdk/health.svg)

```
[![Health](https://phpackages.com/badges/crafterlp-active-servers-sdk/health.svg)](https://phpackages.com/packages/crafterlp-active-servers-sdk)
```

###  Alternatives

[stripe/stripe-php

Stripe PHP Library

4.0k143.3M475](/packages/stripe-stripe-php)[twilio/sdk

A PHP wrapper for Twilio's API

1.6k92.9M270](/packages/twilio-sdk)[knplabs/github-api

GitHub API v3 client

2.2k15.8M186](/packages/knplabs-github-api)[facebook/php-business-sdk

PHP SDK for Facebook Business

90121.9M34](/packages/facebook-php-business-sdk)[meilisearch/meilisearch-php

PHP wrapper for the Meilisearch API

73813.7M114](/packages/meilisearch-meilisearch-php)[google/gax

Google API Core for PHP

263103.1M452](/packages/google-gax)

PHPackages © 2026

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