Overview

Welcome to the 4b42 API! Our API allows you to easily access your 4b42 account, get information about your products.

What should I know before starting?

Our API is continuously being developed and improved, but we are still trying to keep it as stable as possible. We try to only have changes that are backwards compatible: usually the changes are only additions, e.g. new resources are implemented or new properties are added to existing resources. Sometimes breaking changes cannot be avoided, e.g. when a new feature requires an incompatible change to the underlying data model, all those changes will be documented in the change log.

Methods

We use the following methods for our api:

Method Type Meaning
post Create Create a new instance
get Read Query/list instances
put Update Update a specific instance
delete Delete Delete a specific instance

Errors

When an error is encountered you will receive an HTTP status code along with a message and error code in the body of the response. The message is intended to give a user-friendly explanation of the error while the error codes are designed to be machine readable codes that applications can use to better understand the context of the error and react appropriately.

We use the following status codes for errors:

Status Code Meaning
200 OK - Request successful executed.
400 Bad Request – The request contains errors.
401 Unauthorized – The authentication process failed, or the access token is not valid.
403 Forbidden – Access to this resource is restricted for the given caller.
404 Not Found – The specified resource could not be found.
405 Method Not Allowed – An invalid method was used to access a resource.
406 Not Acceptable – An unsupported format was requested.
409 Conflict – The requested operation on the resource cannot be made due the resource state.
500 Internal Server Error – There was a problem with the API host server. Try again later.
503 Service Unavailable – API is temporarily offline for maintenance. Try again later.

TODO.

Status Code Meaning
INVALID_INPUT .
INVALID_INPUT_IPV4 ...
INVALID_INPUT_IPV6 .
INVALID_INPUT_MAC .

Authentication

There are a few different ways to get an 4b42 api key. The first option listed, using user credentials, will be the most common.

User credentials

Generates a 4b42 api key which can be used in subsequent calls to 4b42 API. This resource uses Password Authorization. Follow these steps to retrieve an api key:

get curl -u USERNAME:'PASSWORD' https://api.4b42.com
{}

API Key

Once you have the 4b42 apie key, you can make the request to the api. To do this, add your api key to the request header.

get curl --header "4b42-KEY:hVQ8UPC3TZOrqWe9bM1nk4m27" https://api.4b42.com
{}

customer

POST Customer

Create new customer

POST /customer
{
    "company": "Company Name",
    "street": "Street",
    "postalcode": "PostalCode",
    "city": "City",
    "state": "State",
    "country": "Country",
    "id": "00000000"
}
Parameter
fieldtypedescriptionvalue
companyStringcompany name or Real- and Firstname for persons.
streetoptionalStringstreet and street number
postalcodeoptionalNumberPostal code
cityoptionalStringCity
stateoptionalStringState
countryoptionalStringCountry

GET Customer

List Details of a specific customer

GET /customer/{customerNumber}
{
    "id": "Customer number",
    "company": "Name of Company or Person",
    "street": "Street",
    "postalcode": "Postalcode",
    "city": "City or Location",
    "state": "State\/Province",
    "country": "Country"
}
Parameter
fieldtypedescriptionvalue
customerNumberString 

GET Customer

List all Customers of Reseller

GET /customer
[
    "00000001",
    "00000002",
    "00000011",
    "00000016",
    "00000048"
]
Errors
StatusCodeDescription
403NOT_A_RESELLERyou dont have permissson for this request, you have to be a member of the reseller group.

DELETE Customer

Remove a Customer

DELETE /customer/{customerNumber}
[]
Parameter
fieldtypedescriptionvalue
customerNumberString 
Errors
StatusCodeDescription
403NOT_A_RESELLERyou dont have permissson for this request, you have to be a member of the reseller group.

customer/user

GET User

List all Users of a Customer

GET /customer/{customerNumber}/user
[]
Parameter
fieldtypedescriptionvalue
customerNumberString 

products

TODO

products/order

POST Nameserver

Order a Product

POST /products/order/{productid}
[]
Parameter
fieldtypedescriptionvalue
productidString 

GET Nameserver

List available bind nameserver offers

GET /products/order
[
    {
        "id": "1",
        "name": "lite",
        "price": "0.00",
        "price_setup": "0"
    },
    {
        "id": "2",
        "name": "essentials",
        "price": "0.00",
        "price_setup": "0"
    }
]

GET Nameserver

List details

GET /products/order/{productid}
{
    "id": "1",
    "name": "lite",
    "features": {
        "zones": {
            "value": "1",
            "price": 0
        },
        "records": {
            "value": "100",
            "price": 0
        },
        "dnssec": {
            "value": false,
            "price": 0
        },
        "api": {
            "value": false,
            "price": 0
        }
    },
    "locations": [
        "FR",
        "CA"
    ],
    "price": "0.00",
    "price_setup": "0"
}
Parameter
fieldtypedescriptionvalue
productidString 

products/order/bind

GET Nameserver

List available bind nameserver offers

GET /products/order/bind
[
    {
        "id": "1",
        "name": "lite",
        "price": "0.00",
        "price_setup": "0"
    },
    {
        "id": "2",
        "name": "essentials",
        "price": "0.00",
        "price_setup": "0"
    }
]

GET Nameserver

List details

GET /products/order/bind/{productid}
{
    "id": "1",
    "name": "lite",
    "features": {
        "zones": {
            "value": "1",
            "price": 0
        },
        "records": {
            "value": "100",
            "price": 0
        },
        "dnssec": {
            "value": false,
            "price": 0
        },
        "api": {
            "value": false,
            "price": 0
        }
    },
    "locations": [
        "FR",
        "CA"
    ],
    "price": "0.00",
    "price_setup": "0"
}
Parameter
fieldtypedescriptionvalue
productidString 

products/manage/docker

GET Install

Get all zones

GET /product/manage/docker
[]
Errors
StatusCodeDescription
404INVALID_INPUTZone not found

products/manage/bind

POST Record

Create a new resource record for zone

POST /product/manage/{customerid}/bind/{productid}/{zone}/record
[]
Parameter
fieldtypedescriptionvalue
hostStringname for resource record (like www,mail,etc.)
typeStringresource record type (like A,AAAA,CNAME,MX,TXT)
destStringdestination for resource record (like 10.48.42.1 or mail.4b42.com)

GET Record

Get all resource records by zone

GET /product/manage/{customerid}/bind/{productid}/{zone}/record
[]
Parameter
fieldtypedescriptionvalue
customeridString 
productidString 
zoneString 

GET Zone

Get details of zone

GET /product/manage/{customerid}/bind/{productid}/zone/{zone}
[]
Parameter
fieldtypedescriptionvalue
customeridString 
productidString 
zoneString 
Errors
StatusCodeDescription
404INVALID_INPUTZone not found

GET Zone

Get all zones

GET /product/manage/{customerid}/bind/{productid}/zones
[
    "4b42.com"
]
Parameter
fieldtypedescriptionvalue
customeridString 
productidString 
Errors
StatusCodeDescription
404INVALID_INPUTZone not found

tools

TODO

tools/teamspeak/server

GET Releases

List of available teamspeak server releases.

GET /tools/teamspeak/server/releases
[
    "3.0.0",
    "3.0.1",
    "3.0.2",
    "3.0.3",
    "3.0.5",
    "3.0.6",
    "3.0.6.1",
    "3.0.7",
    "3.0.7.1",
    "3.0.7.2",
    "3.0.8",
    "3.0.9",
    "3.0.10",
    "3.0.10.1",
    "3.0.10.2",
    "3.0.10.3",
    "3.0.11",
    "3.0.11.1",
    "3.0.11.2",
    "3.0.11.3",
    "3.0.11.4",
    "3.0.12",
    "3.0.12.1",
    "3.0.12.2",
    "3.0.12.3",
    "3.0.12.4",
    "3.0.13",
    "3.0.13.1",
    "3.0.13.2",
    "3.0.13.3",
    "3.0.13.4",
    "3.0.13.5",
    "3.0.13.6"
]

GET Latest Release

List latest available teamspeak server release.

GET /tools/teamspeak/server/latest
"3.0.13.6"

tools/security/blacklist

POST blacklist

Add new blacklist entry

POST /tools/security/blacklist
[]
Parameter
fieldtypedescriptionvalue
valueStringDomain or ip-address
categoryStringCategory (TrashMail|infected)
Errors
StatusCodeDescription
403NOT_A_RESELLERyou dont have permissson for this request, you have to be a member of the reseller group.

tools/nextcloud

GET Releases

List all available nextcloud releases.

GET /tools/nextcloud/releases
[
    "9.0.50",
    "9.0.51",
    "9.0.52",
    "9.0.53",
    "9.0.54",
    "9.0.55",
    "9.0.56",
    "9.0.57",
    "9.0.58",
    "10.0.0",
    "10.0.1",
    "10.0.2",
    "10.0.3",
    "10.0.4",
    "10.0.5",
    "10.0.6",
    "11.0.0",
    "11.0.1",
    "11.0.2",
    "11.0.3",
    "11.0.4",
    "11.0.5",
    "11.0.6",
    "12.0.0",
    "12.0.1",
    "12.0.2",
    "12.0.3",
    "12.0.4"
]

GET Latest Release

List latest available nextcloud release.

GET /tools/nextcloud/latest
"12.0.4"

tools/network/whois

GET Whois

We have our own whois database, you can search for ipv4 and ipv6 addresses as follow:

GET /tools/network/whois/{IP-Address}
{
    "as": "15169",
    "city": "Mountain View",
    "cc": "US",
    "end": "134744319",
    "isp": "Google Inc.",
    "latitude": "37.386002",
    "longitude": "-122.083801",
    "netname": "LVLT-GOGL-8-8-8",
    "prefix": "8.8.8.0\/24",
    "start": "134744064",
    "timestamp": "1467895522",
    "country": "United States",
    "first": "8.8.8.0",
    "ip": "8.8.8.8",
    "last": "8.8.8.255",
    "timezone": "America\/Los_Angeles"
}
Parameter
fieldtypedescriptionvalue
IP-AddressString 

tools/network/mac2vendor

GET MAC to Vendor

You can use our mac address database, to get the vendor for your device.

GET /tools/network/mac2vendor/{MAC-Address}
{
    "mac": "78:e3:b5:00:4b:42",
    "vendor": "Hewlett-Packard"
}
Parameter
fieldtypedescriptionvalue
MAC-AddressString 

tools/network/long2ip

GET long2ip

Converts an long integer address into a string in (IPv4) Internet standard dotted format

GET /tools/network/long2ip/{IP-Address}
null
Parameter
fieldtypedescriptionvalue
IP-AddressString 

tools/network/ip2long

GET ip2long

Converts a string containing an (IPv4) Internet Protocol dotted address into a long integer

GET /tools/network/ip2long/{IP-Address}
4294967295
Parameter
fieldtypedescriptionvalue
IP-AddressString 

tools/mobotix/camera

GET Releases

List of available software updates for MOBOTIX cameras.

GET /tools/mobotix/camera/releases
[
    "4.4.2.51.r1",
    "4.4.2.34",
    "4.4.1.56",
    "4.4.1.55",
    "4.4.0.31.r1",
    "4.4.0.31",
    "4.3.4.83",
    "4.3.4.66",
    "4.3.4.50",
    "4.3.2.77",
    "4.3.2.72",
    "4.3.2.68",
    "4.3.2.53",
    "4.3.2.45",
    "4.3.0.15",
    "4.2.1.61",
    "4.2.1.43",
    "4.1.10.35",
    "4.1.10.28",
    "4.1.9.29",
    "4.1.6.27",
    "4.1.6.25",
    "4.1.4.70",
    "4.1.4.11",
    "4.1.1.24",
    "4.1.1.21",
    "4.1.1.7",
    "4.0.4.28",
    "4.0.4.19",
    "4.0.4.18",
    "4.0.2.33.r2",
    "4.0.2.33",
    "4.0.2.23",
    "4.0.1.15"
]