NAV
INTERNETPORT AB
bash php python

Introduction

Our HTTP REST API allows you to manage vital details of your account and services in client portal. JSON is used for all API returns

Use left menu to browse trough available methods, use right menu to check required parameters, data to post and code samples in various languages.

Authentication

To authorize, use this code:

# With bash, you can just pass the correct header with each request
curl 'http://slitz.se/api' \
  -u "username:passowrd"
//We recomend to use Requests library available at https://github.com/rmccue/Requests
require_once 'Requests.php';
Requests::register_autoloader();

$resp = Requests::get('http://slitz.se/api/details', array(), array(
    'auth' => array('username', 'passowrd')
));
# python requests modulle will handle basic authentication if provided with auth parameter
import requests

req = requests.get('http://slitz.se/api/details', auth=('username', 'passowrd'))

Make sure to replace username and password with your client area details.

This API uses Basic HTTP Authentication.

To authenticate with API with your client area acces details (email address as username and your clientarea password).

All API calls requires authentication, API expects for the auth to be included in a header that looks like the following:

Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZQ==

Clientarea

User Details

Return registration details for my account

curl "http://slitz.se/api/details" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/details', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/details', auth=auth)
print(req.json())
Example Response:
{
    "client": {
        "id": "20408",
        "email": "email@example.com",
        "lastlogin": "2015-09-17 09:00:20",
        "ip": "10.10.10.100",
        "host": "unknown",
        "status": "Active",
        "parent_id": "0",
        "firstname": "John",
        "lastname": "Doe",
        "companyname": "Company name",
        "address1": "Addres 1",
        "address2": "Addres 2",
        "city": "City",
        "state": "Alabama",
        "postcode": "Post code",
        "country": "US",
        "phonenumber": "+01.222444111",
        "datecreated": "2015-03-16",
        "language": "english",
        "company": "1",
        "credit": "0.0000",
        "privileges": null
    }
}

HTTP Request

GET /details

Update User Details

Update registration details under my account

curl "http://slitz.se/api/details" \
   -u user:pass \
   -d type="typeValue"\
   -d companyname="companynameValue"\
   -d vateu="vateuValue"\
   -d firstname="firstnameValue"\
   -d lastname="lastnameValue"\
   -d email="emailValue"\
   -d address1="address1Value"\
   -d address2="address2Value"\
   -d city="cityValue"\
   -d state="stateValue"\
   -d postcode="postcodeValue"\
   -d country="countryValue"\
   -d phonenumber="phonenumberValue"\
   -d orgpersonnr="orgpersonnrValue"\
   -d mobilephone="mobilephoneValue"\
   -d referens="referensValue"
$data = array(
    'type'=>'typeValue',
    'companyname'=>'companynameValue',
    'vateu'=>'vateuValue',
    'firstname'=>'firstnameValue',
    'lastname'=>'lastnameValue',
    'email'=>'emailValue',
    'address1'=>'address1Value',
    'address2'=>'address2Value',
    'city'=>'cityValue',
    'state'=>'stateValue',
    'postcode'=>'postcodeValue',
    'country'=>'countryValue',
    'phonenumber'=>'phonenumberValue',
    'orgpersonnr'=>'orgpersonnrValue',
    'mobilephone'=>'mobilephoneValue',
    'referens'=>'referensValue'
);
$resp = Requests::post('http://slitz.se/api/details', array(), $data, $options);

echo $resp->body;
payload = {
    'type':'typeValue',
    'companyname':'companynameValue',
    'vateu':'vateuValue',
    'firstname':'firstnameValue',
    'lastname':'lastnameValue',
    'email':'emailValue',
    'address1':'address1Value',
    'address2':'address2Value',
    'city':'cityValue',
    'state':'stateValue',
    'postcode':'postcodeValue',
    'country':'countryValue',
    'phonenumber':'phonenumberValue',
    'orgpersonnr':'orgpersonnrValue',
    'mobilephone':'mobilephoneValue',
    'referens':'referensValue'
}
req = requests.post('http://slitz.se/api/details', params=payload, auth=auth)
print(req.json())

HTTP Request

POST /details

Query Parameters

Parameter Type Description
type string Account Type
companyname string Organization
vateu string VAT EU - If you have valid VAT-EU registered number please provide it here
firstname string First Name
lastname string Last Name
email string Email Address
address1 string Address 1
address2 string Address 2
city string City
state string State
postcode string Post code
country string Country
phonenumber string Phone
orgpersonnr string Org/Personnr
mobilephone string Mobile phone number - To receive SMS notifications about your services with us please provide your mobile phone number, starting with country code prefix, ie. +1
referens string Er referens

Billing

Account balance

Get current account balance(unpaid invoices total), account credit

curl "http://slitz.se/api/balance" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/balance', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/balance', auth=auth)
print(req.json())
Example Response:
{
  "details": {
    "acc_balance": "10.00",
    "acc_credit": "0.00"
  }
}

HTTP Request

GET /balance

List Invoices

List all invoices under my account

curl "http://slitz.se/api/invoice" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/invoice', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/invoice', auth=auth)
print(req.json())
Example Response:
{
    "invoices": [
        {
            "id": "239780",
            "date": "2015-05-26",
            "duedate": "2015-05-26",
            "paybefore": "2015-05-26",
            "total": "10.00",
            "datepaid": "0000-00-00 00:00:00",
            "status": "Unpaid",
            "merge_id": null,
            "number": "239780",
            "currency": "USD"
        }
    ]
}

HTTP Request

GET /invoice

Invoice Details

Get invoice details

curl "http://slitz.se/api/invoice/@id" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/invoice/@id', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/invoice/@id', auth=auth)
print(req.json())
Example Response:
{
    "invoice": {
        "id": "303090",
        "status": "Paid",
        "date": "2015-08-05",
        "duedate": "2015-08-05",
        "paybefore": "2015-08-05",
        "datepaid": "2015-09-10 13:13:37",
        "number": "2015-09-25",
        "currency": "USD",
        "subtotal": 58.5,
        "credit": 0,
        "tax": 0,
        "taxrate": 22,
        "tax2": 0,
        "taxrate2": 0,
        "taxexempt": "0",
        "total": 58.5,
        "rate": 1,
        "rate2": 0,
        "rate3": 1,
        "notes": "",
        "items": [
            {
                "id": "264330",
                "invoice_id": "303090",
                "type": "Hosting",
                "item_id": "33334",
                "description": "Hosting - Starter Hosting (2015.08.05 - 2015.09.04)",
                "amount": "58.50",
                "taxed": "0",
                "qty": "1.00",
                "linetotal": "58.50"
            }
        ],
        "client": {
            ...
        }
    }
}

HTTP Request

GET /invoice/@id

Query Parameters

Parameter Type Description
id int

Support

List Tickets

List support tickets under my account

curl "http://slitz.se/api/tickets" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/tickets', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/tickets', auth=auth)
print(req.json())
Example Response:
{
    "tickets": [
        {
            "client_read": "1",
            "ticket_number": "437928",
            "date": "2015-05-12 12:01:45",
            "deptname": "Support Tickets",
            "subject": "Example Ticket",
            "status": "Open"
        }
    ]
}

HTTP Request

GET /tickets

Ticket details

Get ticket details, including all replies

curl "http://slitz.se/api/tickets/@number" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/tickets/@number', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/tickets/@number', auth=auth)
print(req.json())
Example Response:
{
    "tickets": {
        "date": "2015-05-12 12:01:45",
        "ticket_number": "437928",
        "name": "John Doe",
        "email": "john@doe2.com",
        "subject": "Example Ticket",
        "status": "Open",
        "client_read": "1",
        "deptname": "Support"
    },
    "replies": [
        {
            "id": "57",
            "name": "Default User",
            "date": "2015-05-13 08:05:46",
            "body": "Example admin reply",
            "status": "Sent",
            "type": "Admin"
        },
        {
            "id": "58",
            "name": "John Doe",
            "date": "2015-05-13 08:06:07",
            "body": "Example client reply",
            "status": "Sent",
            "type": "Client"
        }
    ]
}

HTTP Request

GET /tickets/@number

Query Parameters

Parameter Type Description
number int Ticket number

Domains

List Domains

List domains under your account

curl "http://slitz.se/api/domain" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/domain', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/domain', auth=auth)
print(req.json())
Example Response:
{
    "domains": [
        {
            "id": "548",
            "name": "example.com",
            "expires": "2016-08-04",
            "recurring_amount": "10.00",
            "date_created": "2015-08-04",
            "status": "Active",
            "period": "1",
            "autorenew": "1",
            "daytoexpire": "322"
        }
    ]
}

HTTP Request

GET /domain

Domain details

Get domain details

curl "http://slitz.se/api/domain/@id" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/domain/@id', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/domain/@id', auth=auth)
print(req.json())
Example Response:
{
    "details": {
        "id": "548",
        "name": "example.com",
        "date_created": "2015-08-04",
        "firstpayment": "10.00",
        "recurring_amount": "10.00",
        "period": "1",
        "expires": "2016-08-04",
        "status": "Active",
        "next_due": "2016-08-04",
        "next_invoice": "2016-07-28",
        "idprotection": "0",
        "nameservers": [
            "ns1.example.com",
            "ns2.example.com",
            "ns3.example.com",
            ""
        ],
        "autorenew": "1"
    }
}

HTTP Request

GET /domain/@id

Query Parameters

Parameter Type Description
id int Domain id

Domain availability

Check if domain is available for registration. Returns status: "ok" if domain is available, empty response otherwise

curl "http://slitz.se/api/domainorder/status" \
   -u user:pass \
   -d name="nameValue"
$data = array(
    'name'=>'nameValue'
);
$resp = Requests::post('http://slitz.se/api/domainorder/status', array(), $data, $options);

echo $resp->body;
payload = {
    'name':'nameValue'
}
req = requests.post('http://slitz.se/api/domainorder/status', params=payload, auth=auth)
print(req.json())
Example Response:
{"details":{"status":"ok"}}

HTTP Request

POST /domainorder/status

Query Parameters

Parameter Type Description
name string Domain name, ie. example.com

Services

Most of API methods found here will require service @id, you can lookup your service ids with /service method

List services

List all services under your account

curl "http://slitz.se/api/service" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/service', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/service', auth=auth)
print(req.json())
Example Response:
{
    "services": [
        {
            "id": "33301",
            "domain": "example.com",
            "total": "10.0000",
            "status": "Active",
            "billingcycle": "Monthly",
            "next_due": "2015-10-22",
            "category": "Hosting",
            "category_url": "hosting",
            "name": "Starter Hosting"
        }
    ]
}

HTTP Request

GET /service

Service details

Return details for service @id

curl "http://slitz.se/api/service/@id" \
   -u user:pass 
$resp = Requests::get('http://slitz.se/api/service/@id', array(), $options);

echo $resp->body;
req = requests.get('http://slitz.se/api/service/@id', auth=auth)
print(req.json())
Example Response:
{
    "service": {
        "id": "33337",
        "date_created": "2015-09-02",
        "domain": "example.com",
        "firstpayment": "10.00",
        "total": "10.00",
        "billingcycle": "Monthly",
        "next_due": "2015-10-22",
        "next_invoice": "2015-10-20",
        "status": "Active",
        "label": "",
        "username": "",
        "password": "",
        "rootpassword": "",
        "name": "Starter Hosting"
    }
}

HTTP Request

GET /service/@id

Query Parameters

Parameter Type Description
id int Service id