PHPackages                             nameisp/api3-lib - 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. nameisp/api3-lib

ActiveLibrary[API Development](/categories/api)

nameisp/api3-lib
================

API v.3.0 client

v0.1(8y ago)27872MITPHPPHP &gt;=5.5

Since Feb 19Pushed 8y ago2 watchersCompare

[ Source](https://github.com/nameisp/php2api)[ Packagist](https://packagist.org/packages/nameisp/api3-lib)[ RSS](/packages/nameisp-api3-lib/feed)WikiDiscussions master Synced 4d ago

READMEChangelogDependencies (2)Versions (2)Used By (0)

API v.3.0 client
================

[](#api-v30-client)

**Table of Contents**

- [Installation](#installation)
- [Usage](#usage)
- [Error handling](#error-handling)
- [Methods](#methods)
    - [Domains](#domains)
        - [createDomainRegistration](#createdomainregistration)
        - [createDomainTransfer](#createdomaintransfer)
        - [domainDetails](#domaindetails)
        - [domainGenAuthCode](#domaingenauthcode)
        - [domainList](#domainlist)
        - [editDomain](#editdomain)
        - [searchDomain](#searchdomain)
        - [updateDomainDNS](#updatedomaindns)
        - [updateDomainRenew](#updatedomainrenew)
    - [DNS](#dns)
        - [checkDnsZone](#checkdnszone)
        - [dnsAddRecord](#dnsaddrecord)
        - [dnsDeleteRecord](#dnsdeleterecord)
        - [dnsGetRecords](#dnsgetrecords)
        - [dnsUpdateRecord](#dnsupdaterecord)
        - [publishDnsSec](#publishdnssec)
        - [unpublishDnsSec](#unpublishdnssec)
    - [Economy](#economy)
        - [priceList](#pricelist)
    - [Miscellaneous](#miscellaneous)
        - [createLabel](#createlabel)
        - [deleteLabel](#deletelabel)
        - [getLabels](#getlabels)
        - [updateLabel](#updatelabel)
    - [Request](#request)
        - [requestCancellation](#requestcancellation)
        - [requestDetails](#requestdetails)
        - [requestList](#requestlist)
        - [requestUpdate](#requestupdate)
    - [Contacts](#contacts)
        - [contactList](#contactlist)
        - [createContact](#createcontact)
        - [updateContact](#updatecontact)

### Installation

[](#installation)

You need [composer](https://getcomposer.org/) to install this library.

```
composer require nameisp/api3-lib
```

### Usage

[](#usage)

```
use NameISP\API3\Client;

$api = new Client('YOUR_API_KEY');
```

If you want to use non-default another base URL for api, you could pass it as second parameter:

```
$api = new Client('YOUR_API_KEY', 'https://example.com/api');
```

### Error handling

[](#error-handling)

There are some types of exceptions, that you are able to catch:

**NameISP\\API3\\Exception\\BaseException**

If you want to catch all exception types from this library, you should use this exception class:

```
use NameISP\API3\Exception\BaseException;

try {
    $api->searchDomain('example.org');
} catch (BaseException $e) {
    // Do something...
}
```

This should be enought for a basic application. But if you need more control you could also catch these exceptions:

**NameISP\\API3\\Exception\\ApiException**

When API returns non-succesful response. You are able to get API error code and message from that exception:

```
use NameISP\API3\Exception\ApiException;

try {
    $api->searchDomain('example.org');
} catch (ApiException $e) {
    var_dump($e->getCode()); // int(2303)
    var_dump($e->getMessage()); // string(21) "Object does not exist"
}
```

**NameISP\\API3\\Exception\\AuthFailedException**

This exception throws when authorization was failed with your API token.

**NameISP\\API3\\Exception\\NetworkException**

Any network exception. If you need more details, you could get original [Guzzle](http://docs.guzzlephp.org/en/latest/index.html) exception by using `$e->getPrevious();`

Methods
=======

[](#methods)

If some argument is null by default, it's optional, others are required.

If you want to unset boolean flag, you should pass `false` (e.g. `$setAutoRenew` argument in the `editDomain` method)

Almost all methods return an array as result. Some returns string. The [checkDnsZone](#checkdnszone) method returns boolean.

Domains
-------

[](#domains)

### createDomainRegistration

[](#createdomainregistration)

```
/**
 * @param string $domainName must be fully qualified domain name
 * @param int $itemYear
 * @param int $ownerId
 * @param int $adminId
 * @param int $techId
 * @param bool $autoRenew
 * @param bool $shieldWhoIs
 * @param bool $trustee
 * @param bool $tmchacceptance is only required if the domain name has a claim. If there is no claim this parameter is ignored.
 */
public function createDomainRegistration($domainName, $itemYear, $ownerId, $adminId = null, $techId = null, $autoRenew = null, $shieldWhoIs = null, $trustee = null, $tmchacceptance = null)
```

[Example](doc/createDomainRegistration.md)

### createDomainTransfer

[](#createdomaintransfer)

```
/**
 * @param string $domainName must be fully qualified domain name
 * @param string $auth
 */
public function createDomainTransfer($domainName, $auth = false)
```

[Example](doc/createDomainTransfer.md)

### domainDetails

[](#domaindetails)

```
/**
 * @param int $itemid
 */
public function domainDetails($itemid)
```

[Example](doc/domainDetails.md)

### domainGenAuthCode

[](#domaingenauthcode)

```
/**
 * @param string $domainName
 */
public function domainGenAuthCode($domainName)
```

[Example](doc/domainGenAuthCode.md)

### domainList

[](#domainlist)

```
/**
 * @param string $domainName
 * @param int $limit default: 100, min: 1 max: 1000, invalid values are ignored and default value is used
 * @param int $start default: 0
 */
public function domainList($domainName = null, $limit = null, $start = null)
```

[Example](doc/domainList.md)

### editDomain

[](#editdomain)

```
/**
 * @param array|string $domainName must be fully qualified domain name
 * @param bool $setAutoRenew
 * @param bool $setShieldWhoIs
 * @param array $addLabel
 * @param array $removeLabel
 */
public function editDomain($domainName, $setAutoRenew = null, $setShieldWhoIs = null, array $addLabel = null, array $removeLabel = null)
```

Example:

```
$api->editDomain('example.com', false, null, ['label']); // Returns an empty array on success
```

### searchDomain

[](#searchdomain)

```
/**
 * @param array|string $domainName
 */
public function searchDomain($domainName)
```

[Example](doc/searchDomain.md)

### updateDomainDNS

[](#updatedomaindns)

```
/**
 * @param string $domainName must be fully qualified domain name
 * @param array $nameServer
 */
public function updateDomainDNS($domainName, array $nameServer)
```

[Example](doc/updateDomainDNS.md)

### updateDomainRenew

[](#updatedomainrenew)

```
/**
 * @param string $domainName must be fully qualified domain name
 * @param int $itemYear
 */
public function updateDomainRenew($domainName, $itemYear)
```

[Example](doc/updateDomainRenew.md)

DNS
---

[](#dns)

### checkDnsZone

[](#checkdnszone)

```
/**
 * @param string $domainName
 * @param string $nameServer
 */
public function checkDnsZone($domainName, $nameServer)
```

Example:

```
$api->checkDnsZone('example.com', 'ns1.nameisp.info'); // Returns true or false
```

### dnsAddRecord

[](#dnsaddrecord)

```
/**
 * DnsAddRecord
 *
 * Notes:
 * Using $type = redirect will create a redirect
 *  - Valid values for $redirectType are 301, 302 & frame. Default: 301
 *  - Forward url is to be entered in content ex. http://www.example.com
 * Using $type = mailforward will create a mailforward
 *  - Valid values for name is full qualified email address for the domainname
 *  - Forward email is to be entered in content ex. example@example.com
 *
 * @param string $domainName
 * @param string $name
 * @param string $type
 * @param string $content
 * @param int $ttl
 * @param int $prio
 * @param string $redirectType
 */
public function dnsAddRecord($domainName, $name, $type, $content, $ttl, $prio = null, $redirectType = null)
```

[Example](doc/dnsAddRecord.md)

### dnsDeleteRecord

[](#dnsdeleterecord)

```
/**
 * @param int $recordId
 * @param string $domainName
 */
public function dnsDeleteRecord($recordId, $domainName)
```

Example:

```
$api->dnsDeleteRecord(16992196,  'example.com'); // Returns an empty array on success
```

### dnsGetRecords

[](#dnsgetrecords)

```
/**
 * @param string $domainName
 */
public function dnsGetRecords($domainName)
```

[Example](doc/dnsGetRecords.md)

### dnsUpdateRecord

[](#dnsupdaterecord)

```
/**
 * DnsUpdateRecord
 *
 * Notes:
 * Using type = redirect will create a redirect
 *  - Valid values for redirecttype are 301, 302 & frame. Default: 301
 *  - Forward url is to be entered in content ex. http://www.example.com
 *
 * @param int $recordId
 * @param string $domainName
 * @param string $name
 * @param string $type
 * @param string $content
 * @param int $ttl
 * @param int $prio
 * @param string $redirectType
 */
public function dnsUpdateRecord($recordId, $domainName, $name, $type, $content, $ttl, $prio = null, $redirectType = null)
```

Example:

```
$api->dnsUpdateRecord(16992196, 'example.com', '*.example.com', 'A', '1.1.1.2', 3600); // Returns an empty array on success
```

### publishDnsSec

[](#publishdnssec)

```
/**
 * PublishDnsSec
 *
 * Notes:
 * $flags
 *  - 256 ZSK
 *  - 257 KSK
 * $alg can at the time of writing use one of the following integers:
 *  - 5 RSA/SHA-1
 *  - 7 RSASHA1-NSEC3-SHA1
 *  - 8 RSA/SHA-256
 *  - 10 RSA/SHA-512
 *  - 12 GOST R 34.10-2001
 *  - 13 ECDSA/SHA-256
 *  - 14 ECDSA/SHA-384
 *
 * @param string $domainName
 * @param string $dnsKey
 * @param int $flags
 * @param int $alg
 */
public function publishDnsSec($domainName, $dnsKey, $flags, $alg)
```

Example:

```
$api->publishDnsSec('example.com', 'c6884357e49fd6b1fdede867c96aafb1', 256, 5); // Returns an empty array on success
```

### unpublishDnsSec

[](#unpublishdnssec)

```
/**
 * @param string $domainName
 */
public function unpublishDnsSec($domainName)
```

Example:

```
$api->unPublishDnsSec('example.com'); // Returns an empty array on success
```

Economy
-------

[](#economy)

### priceList

[](#pricelist)

```
/**
 * PriceList
 *
 * Note:
 * Using $print will ignore $limit and $start parameters, WARNING using $print = true will result with a large JSON object, it’s recommended to use $print = true together with $skipRules = true to limit the JSON size.
 *
 * @param bool $print
 * @param bool $skipRules
 * @param string $tldName
 * @param int $priceTypes
 * @param int $limit
 * @param int $start
 */
public function priceList($print = null, $skipRules = null, $tldName = null, $priceTypes = null, $limit = null, $start = null)
```

[Example](doc/priceList.md)

Miscellaneous
-------------

[](#miscellaneous)

### createLabel

[](#createlabel)

```
/**
 * @param string $label
 * @param integer $starred
 */
public function createLabel($label, $starred = null)
```

[Example](doc/createLabel.md)

### deleteLabel

[](#deletelabel)

```
/**
 * @param int $labelId
 */
public function deleteLabel($labelId)
```

Example:

```
$api->deleteLabel(2317); // Returns an empty array on success
```

### getLabels

[](#getlabels)

```
public function getLabels()
```

[Example](doc/getLabels.md)

### updateLabel

[](#updatelabel)

```
/**
 * UpdateLabel
 *
 * Note:
 * Valid parameter values are: name, starred
 *
 * @param int $labelId
 * @param string $parameter
 * @param string $value
 */
public function updateLabel($labelId, $parameter, $value)
```

Example:

```
$api->updateLabel(2317, 'name', 'updated label 1'); // Returns an empty array on success
```

Request
-------

[](#request)

### requestCancellation

[](#requestcancellation)

```
/**
 * RequestCancellation
 *
 * Note:
 * Only statuses with cancelable flag are cancelable.
 *
 * @param int $reqId
 */
public function requestCancellation($reqId)
```

[Example](doc/requestCancellation.md)

### requestDetails

[](#requestdetails)

```
/**
 * @param int $reqId
 */
public function requestDetails($reqId)
```

[Example](doc/requestDetails.md)

### requestList

[](#requestlist)

```
/**
 * @param string $domainName
 * @param string $reqType
 * @param int $limit default: 100, min: 1 max: 1000, invalid values are ignored and default value is used
 * @param int $start default: 0
 */
public function requestList($domainName = null, $reqType = null, $limit = null, $start = null)
```

[Example](doc/requestList.md)

### requestUpdate

[](#requestupdate)

```
/**
 * @param int $reqId
 * @param string $error parameter from error list
 */
public function requestUpdate($reqId, $error)
```

TODO: example

Contacts
--------

[](#contacts)

### contactList

[](#contactlist)

```
/**
 * ContactList
 *
 * Note:
 * Valid $filters keys:
 * firstname, lastname, organization, orgnr, address1, zipcode, city, countrycode, phone, fax, email
 *
 * @param array $filters key-value array with filters
 * @param int $limit default: 100, min: 1 max: 1000, invalid values are ignored and default value is used
 * @param int $start default: 0
 * @param string $searchString is a free text search parameter, use this parameter to search every field. If this parameter is used all other parameters are ignored
 */
public function contactList(array $filters = [], $searchString = null, $limit = null, $start = null)
```

[Example](doc/contactList.md)

### createContact

[](#createcontact)

```
/**
 * @param string $firstName
 * @param string $lastName
 * @param string $email
 * @param string $orgnr
 * @param string $address1
 * @param string $zipCode
 * @param string $city
 * @param string $countryCode
 * @param string $phone
 * @param string $organization
 * @param string $fax
 */
public function createContact($firstName, $lastName, $email, $orgnr, $address1, $zipCode, $city, $countryCode, $phone, $organization = null, $fax = null)
```

[Example](doc/createContact.md)

### updateContact

[](#updatecontact)

```
/**
 * UpdateContact
 *
 * Notes:
 * Private persons can’t update $firstName or $lastName
 * Organization can’t update $organization
 * No one can update orgnr
 * if value does not exist, value is added else it is updated
 *
 * Possible $fields keys:
 * firstname, lastname, organization, address1, zipcode, city, countrycode, phone, fax, email
 *
 * @param int $contactId
 * @param array $fields
 */
public function updateContact($contactId, array $fields)
```

Example:

```
$api->updateContact(1234181, [
    'city' => 'New York',
    'countrycode' => 'us'
]); // Returns an empty array on success
```

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity48

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

3007d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1c31de4fd5f69ca0c7c014a3a3084126478705aec615cdf06388acde5b2bb1d7?d=identicon)[xorik](/maintainers/xorik)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/nameisp-api3-lib/health.svg)

```
[![Health](https://phpackages.com/badges/nameisp-api3-lib/health.svg)](https://phpackages.com/packages/nameisp-api3-lib)
```

###  Alternatives

[tencentcloud/tencentcloud-sdk-php

TencentCloudApi php sdk

3731.2M42](/packages/tencentcloud-tencentcloud-sdk-php)[convertkit/convertkitapi

Kit PHP SDK for the Kit API

2167.1k1](/packages/convertkit-convertkitapi)[mapado/rest-client-sdk

Rest Client SDK for hydra API

1125.9k2](/packages/mapado-rest-client-sdk)

PHPackages © 2026

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