PHPackages                             softservlet/internetbs - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. softservlet/internetbs

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

softservlet/internetbs
======================

3153[1 issues](https://github.com/mariusleu/internetbs-api/issues)PHP

Since May 1Pushed 12y ago2 watchersCompare

[ Source](https://github.com/mariusleu/internetbs-api)[ Packagist](https://packagist.org/packages/softservlet/internetbs)[ RSS](/packages/softservlet-internetbs/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependenciesVersions (1)Used By (0)

Internet.bs API
===============

[](#internetbs-api)

This is an PHP Client for Internet.bs domain registrar api. This package is also bundled to work as an laravel 4 module, but you can use it with any framework or standalone at all.

#### Create the Api object

[](#create-the-api-object)

```
use Softservlet\Internetbs\Api;
use Softservlet\Internetbs\Request\HttpRequest;

//The api credentials
$apiKey = 'testapi';
$passwd = 'testpass';
//We will use the test api in this example
$test = true;

$api = new Api(new HttpRequest($apiKey, $passwd, $test));
```

#### Make an simple api request

[](#make-an-simple-api-request)

The api requests are made by the `request()` method of the api object. It accepts as parameters the api verb and the data to be passed to the request. It returns the response as an array. For full documentation of the api verbs (calls) please visit the internet.bs api docs.

```
$response = $api->request('Domain/Check', array(
		'Domain' => 'github.com'
));

echo $response['status']; //this will display 'UNAVAILABLE'
```

### Using the Command class for requests

[](#using-the-command-class-for-requests)

Commands are a more organised way to make an api request. Instead of passing lot of parameters to the `request()` method, we just can create a command to handle the request that we need. This also helps when you have to do difficult tasks like creating a domain.

#### Create a new command

[](#create-a-new-command)

A command must implement the `Softservlet\Commands\CommandInterface` interface.

```
use Softservlet\Internetbs\Commands\CommandInterface;

class DomainCheck implements CommandInterface
{

	protected $domain;

	public function __construct($domain)
	{
		$this->domain = $domain;
	}

	/**
	 * This method returns the api verb (call)
	 * that should be requested/executed by the command
	 */
	public function getPath()
	{
		return 'Domain/Check';
	}

	/**
	 * This method returns the data that should be passed
	 * to the api call
	 */
	public function run()
	{
		return array('Domain' => $this->domain);
	}
}
```

#### Using the command

[](#using-the-command)

```
$response = $api->run(new DomainCheck('github.com'));

echo $response['status']; //this will display 'UNAVAILABLE'
```

#### The DomainCreate command

[](#the-domaincreate-command)

This package has implemented the task for `Domain/Create` api call. Feel free to fork this package and contribute by adding more commands.

```
$command = new DomainCreate('the-domain-to-register.com');
```

Now let's say that the person who register the domain has the following details:

```
$contactPerson = array(
				'FirstName' => 'Benjamin',
				'LastName' => 'Dawson',
				'Email'	=> 'owner@name.com',
				'Street' => '1865 Shadowmar Drive',
				'CountryCode' => 'RO',
				'PostalCode' => '220099',
				'City' => 'Bucharest'
);
```

Then we can add this person as the `Registrant` person.

```
$command->addContact('Registrant', $contactPerson);
```

But the most of TLDs requires contact persons for roles like `Registrant`, `Admin`, `Technical`, `Billing`, etc. So we can use the following way to add the same person with multiple roles.

```
$roles = array(
	'Registrant',
	'Admin',
	'Technical',
	'Billing'
);

$command->addContact($roles, $contactPerson);
```

The PhoneNumber filed requires special formatting, so you will need to call the following method for it:

```
$command->addPhoneNumber('Registrant', '+1', '310-716-7152');
//or
$command->addPhoneNumber($roles, '+1', '310-716-7152');
```

This commands extends the `AbstractCommand` class wich provides methods for setting and getting custom data for the api parameters, so if you need to add custom data, depending on which domain tld you want to register, just use:

```
$command->setData('my_custom_data', 'my_value');

$command->getData('my_custom_data');
```

Finally, just run the command

```
$api->run($command);
```

For the response documentation visit the internet.bs api website.

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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://avatars.githubusercontent.com/u/6908574?v=4)[softservlet](/maintainers/softservlet)[@softservlet](https://github.com/softservlet)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/softservlet-internetbs/health.svg)

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

PHPackages © 2026

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