NAV
Time4VPS
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 'https://billing.time4vps.eu/api' \
                  -u "username:passowrd"
                
//We recommend to use Requests library available at https://github.com/rmccue/Requests
                require_once 'Requests.php';
                Requests::register_autoloader();

                $resp = Requests::get('https://billing.time4vps.eu/api/details', array(), array(
                    'auth' => array('username', 'passowrd')
                ));
                
# python requests module will handle basic authentication if provided with auth parameter
                import requests

                req = requests.get('https://billing.time4vps.eu/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 access details (email address as username and your client area 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 "https://billing.time4vps.eu/api/details" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/details', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/details', auth=auth)
print(req.json())
Example Response:
{
    "client": {
        "id": "26",
        "email": "api@example.com",
        "lastlogin": "2016-12-30 12:24:28",
        "ip": "172.100.2.1",
        "host": "hostname",
        "firstname": "Joe",
        "lastname": "Doe",
        "companyname": "",
        "address1": "Pretty View Lane",
        "address2": "3294",
        "city": "Santa Rosa",
        "state": "California",
        "postcode": "95401",
        "country": "US",
        "phonenumber": "+1.24123123"
    }
}

HTTP Request

GET /details

Update User Details

Update registration details under my account

curl "https://billing.time4vps.eu/api/details" \
   -u user:pass \
   -d firstname="firstnameValue"\
   -d lastname="lastnameValue"\
   -d phonenumber="phonenumberValue"\
   -d vateu="vateuValue"\
   -d email="emailValue"\
   -d address1="address1Value"\
   -d companyname="companynameValue"\
   -d address2="address2Value"\
   -d city="cityValue"\
   -d state="stateValue"\
   -d postcode="postcodeValue"\
   -d country="countryValue"\
   -d type="typeValue"\
   -d 2faenable="2faenableValue"\
   -d 2fasecret="2fasecretValue"
$data = array(
    'firstname' => 'firstnameValue',
    'lastname' => 'lastnameValue',
    'phonenumber' => 'phonenumberValue',
    'vateu' => 'vateuValue',
    'email' => 'emailValue',
    'address1' => 'address1Value',
    'companyname' => 'companynameValue',
    'address2' => 'address2Value',
    'city' => 'cityValue',
    'state' => 'stateValue',
    'postcode' => 'postcodeValue',
    'country' => 'countryValue',
    'type' => 'typeValue',
    '2faenable' => '2faenableValue',
    '2fasecret' => '2fasecretValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/details', array(), $data, $options);
echo $resp->body;
payload = {
    'firstname' : 'firstnameValue',
    'lastname' : 'lastnameValue',
    'phonenumber' : 'phonenumberValue',
    'vateu' : 'vateuValue',
    'email' : 'emailValue',
    'address1' : 'address1Value',
    'companyname' : 'companynameValue',
    'address2' : 'address2Value',
    'city' : 'cityValue',
    'state' : 'stateValue',
    'postcode' : 'postcodeValue',
    'country' : 'countryValue',
    'type' : 'typeValue',
    '2faenable' : '2faenableValue',
    '2fasecret' : '2fasecretValue'
}
req = requests.put('https://billing.time4vps.eu/api/details', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "client": {
        "id": "26",
        "email": "api@example.com",
        "lastlogin": "2016-12-30 12:34:20",
        "ip": "172.100.2.1",
        "host": "hostname",
        "firstname": "Joe",
        "lastname": "Doe",
        "companyname": "",
        "address1": "Pretty View Lane",
        "address2": "3194",
        "city": "Santa Rosa",
        "state": "California",
        "postcode": "95401",
        "country": "US",
        "phonenumber": "+1.24123123"
    },
    "info": [
        "client_info_updated"
    ]
}

HTTP Request

PUT /details

Query Parameters

Parameter Type Description
firstname string First Name
lastname string Last Name - afwf awf
phonenumber string Phone
vateu string VAT ID
email string Email Address
address1 string Address 1 - Example description
companyname string Organization
address2 string Address 2
city string City
state string State
postcode string Post code
country string Country
type string Account Type
2faenable string Two-Factor Authentication
2fasecret string Two-Factor Secret - If Two-Factor is enabled, enter 16-chars (letters/digits) secret code to use in Google Authenticator App.

List contacts

Return a list of contacts on this account

curl "https://billing.time4vps.eu/api/contact" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/contact', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/contact', auth=auth)
print(req.json())
Example Response:
{
    "contacts": [
        {
            "email": "mary@example.com",
            "id": "49",
            "firstname": "Mary",
            "lastname": "Sue",
            "companyname": "",
            "company": "0",
            "lastlogin": "0000-00-00 00:00:00"
        }
    ]
}

HTTP Request

GET /contact

Query Parameters

Parameter Type Description
number int Ticket number

Add contact

Create new contact account, if password is provided you can use provided email addres to login as that contact.

curl "https://billing.time4vps.eu/api/contact" \
   -u user:pass \
   -d firstname="firstnameValue"\
   -d lastname="lastnameValue"\
   -d phonenumber="phonenumberValue"\
   -d vateu="vateuValue"\
   -d email="emailValue"\
   -d address1="address1Value"\
   -d companyname="companynameValue"\
   -d address2="address2Value"\
   -d city="cityValue"\
   -d state="stateValue"\
   -d postcode="postcodeValue"\
   -d country="countryValue"\
   -d type="typeValue"\
   -d 2faenable="2faenableValue"\
   -d 2fasecret="2fasecretValue"\
   -d password="passwordValue"\
   -d privileges[key]="privilegesValue"
$data = array(
    'firstname' => 'firstnameValue',
    'lastname' => 'lastnameValue',
    'phonenumber' => 'phonenumberValue',
    'vateu' => 'vateuValue',
    'email' => 'emailValue',
    'address1' => 'address1Value',
    'companyname' => 'companynameValue',
    'address2' => 'address2Value',
    'city' => 'cityValue',
    'state' => 'stateValue',
    'postcode' => 'postcodeValue',
    'country' => 'countryValue',
    'type' => 'typeValue',
    '2faenable' => '2faenableValue',
    '2fasecret' => '2fasecretValue',
    'password' => 'passwordValue',
    'privileges' => array('key'=>'value')
);
$resp = Requests::post('https://billing.time4vps.eu/api/contact', array(), $data, $options);
echo $resp->body;
payload = {
    'firstname' : 'firstnameValue',
    'lastname' : 'lastnameValue',
    'phonenumber' : 'phonenumberValue',
    'vateu' : 'vateuValue',
    'email' : 'emailValue',
    'address1' : 'address1Value',
    'companyname' : 'companynameValue',
    'address2' : 'address2Value',
    'city' : 'cityValue',
    'state' : 'stateValue',
    'postcode' : 'postcodeValue',
    'country' : 'countryValue',
    'type' : 'typeValue',
    '2faenable' : '2faenableValue',
    '2fasecret' : '2fasecretValue',
    'password' : 'passwordValue',
    'privileges' : {'key':'value'}
}
req = requests.post('https://billing.time4vps.eu/api/contact', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "profile_added"
    ]
}

HTTP Request

POST /contact

Query Parameters

Parameter Type Description
firstname string First Name
lastname string Last Name - afwf awf
phonenumber string Phone
vateu string VAT ID
email string Email Address
address1 string Address 1 - Example description
companyname string Organization
address2 string Address 2
city string City
state string State
postcode string Post code
country string Country
type string Account Type
2faenable string Two-Factor Authentication
2fasecret string Two-Factor Secret - If Two-Factor is enabled, enter 16-chars (letters/digits) secret code to use in Google Authenticator App.
password string Optional, allows you to login as contact
privileges array Array with privileges that you want to enable. Formatted the same way as output from GET /contact/privileges

Contact privileges

List possible contact privileges. Each domain and service may list additional privileges, depending on available features.

curl "https://billing.time4vps.eu/api/contact/privileges" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/contact/privileges', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/contact/privileges', auth=auth)
print(req.json())
Example Response:
{
    "privileges": {
        "billing": [
            "emails", // Receive billing notifications
            "payinvoice", // Allow to view/pay invoices
            "orders", // Allow to place new orders
            "balance", // View account balance
            "addfunds", // Add account funds
            "creditcard" // Edit Credit Card details
        ],
        "support": [
            "newticket", // Open new tickets
            "tickets", // View all tickets
            "closeticket", // Close tickets
            "emails" // Receive email notifications from support
        ],
        "misc": [
            "editmain", // Modify main profile details
            "emails", // View emails history
            "editipaccess", // Edit allowed IP access
            "manageprofiles", // Add / Edit contacts
            "affiliates" // Access affiliates section
        ],
        "services": {
            "full": 1, // Full control over services
            "332": [
                "basic", // View basic details
                "billing", // View billing info
                "cancelation", // Request cancellation
                "upgrade", // Upgrade / Downgrade
                "notify", // Receive related email notifications	
                (...)
                "logindetails"
            ]
        },
        "domains": {
            "full": 1, // Full control over domains
            "523": [
                "basic", // View basic details
                "renew", // Renew domain
                "notify", // Receive related email notifications	
                "contactinfo", // Contact Information
                (...)
                "nameservers" // Manage Nameservers
            ]
        }
    }
}

HTTP Request

GET /contact/privileges

Get contacts details

Return array with contact details

curl "https://billing.time4vps.eu/api/contact/@id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/contact/@id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/contact/@id', auth=auth)
print(req.json())
Example Response:
{
    "contact": {
        "id": "49",
        "email": "mary@example.com",
        "firstname": "Mary",
        "lastname": "Sue",
        "companyname": "",
        "address1": "Pretty View Lane",
        "address2": "3194",
        "city": "Santa Rosa",
        "state": "California",
        "postcode": "95401",
        "country": "US",
        "phonenumber": "+1.24123123",
        "type": "Private",
        "privileges" : {
            "support" : ["tickets", "newticket"]
        }
    }
}

HTTP Request

GET /contact/@id

Query Parameters

Parameter Type Description
id int Contact ID

Edit contact

Change contact details`

curl "https://billing.time4vps.eu/api/contact/@id" \
   -u user:pass \
   -d firstname="firstnameValue"\
   -d lastname="lastnameValue"\
   -d phonenumber="phonenumberValue"\
   -d vateu="vateuValue"\
   -d email="emailValue"\
   -d address1="address1Value"\
   -d companyname="companynameValue"\
   -d address2="address2Value"\
   -d city="cityValue"\
   -d state="stateValue"\
   -d postcode="postcodeValue"\
   -d country="countryValue"\
   -d type="typeValue"\
   -d 2faenable="2faenableValue"\
   -d 2fasecret="2fasecretValue"\
   -d privileges[key]="privilegesValue"
$data = array(
    'firstname' => 'firstnameValue',
    'lastname' => 'lastnameValue',
    'phonenumber' => 'phonenumberValue',
    'vateu' => 'vateuValue',
    'email' => 'emailValue',
    'address1' => 'address1Value',
    'companyname' => 'companynameValue',
    'address2' => 'address2Value',
    'city' => 'cityValue',
    'state' => 'stateValue',
    'postcode' => 'postcodeValue',
    'country' => 'countryValue',
    'type' => 'typeValue',
    '2faenable' => '2faenableValue',
    '2fasecret' => '2fasecretValue',
    'privileges' => array('key'=>'value')
);
$resp = Requests::put('https://billing.time4vps.eu/api/contact/@id', array(), $data, $options);
echo $resp->body;
payload = {
    'firstname' : 'firstnameValue',
    'lastname' : 'lastnameValue',
    'phonenumber' : 'phonenumberValue',
    'vateu' : 'vateuValue',
    'email' : 'emailValue',
    'address1' : 'address1Value',
    'companyname' : 'companynameValue',
    'address2' : 'address2Value',
    'city' : 'cityValue',
    'state' : 'stateValue',
    'postcode' : 'postcodeValue',
    'country' : 'countryValue',
    'type' : 'typeValue',
    '2faenable' : '2faenableValue',
    '2fasecret' : '2fasecretValue',
    'privileges' : {'key':'value'}
}
req = requests.put('https://billing.time4vps.eu/api/contact/@id', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "profile_updated"
    ]
}

HTTP Request

PUT /contact/@id

Query Parameters

Parameter Type Description
id int
firstname string First Name
lastname string Last Name - afwf awf
phonenumber string Phone
vateu string VAT ID
email string Email Address
address1 string Address 1 - Example description
companyname string Organization
address2 string Address 2
city string City
state string State
postcode string Post code
country string Country
type string Account Type
2faenable string Two-Factor Authentication
2fasecret string Two-Factor Secret - If Two-Factor is enabled, enter 16-chars (letters/digits) secret code to use in Google Authenticator App.
privileges array Array with privileges that you want to enable. Formatted the same way as output from GET /contact/privileges

Billing

Account balance

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

curl "https://billing.time4vps.eu/api/balance" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/balance', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/balance', auth=auth)
print(req.json())
Example Response:
{
    "details": {
        "acc_balance": 0,
        "acc_credit": "0.00"
    }
}

HTTP Request

GET /balance

List Invoices

List all invoices under my account

curl "https://billing.time4vps.eu/api/invoice" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/invoice', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/invoice', auth=auth)
print(req.json())
Example Response:
{
    "invoices": [
        {
            "id": "308976",
            "date": "2016-12-30",
            "dateorig": "2016-12-30",
            "duedate": "2017-01-06",
            "paybefore": "2017-01-06",
            "total": "19.65",
            "datepaid": "2016-12-30 12:40:47",
            "status": "Paid",
            "merge_id": null,
            "number": "2016\/12\/1",
            "currency": "USD"
        }
    ]
}

HTTP Request

GET /invoice

Invoice Details

Get invoice details

curl "https://billing.time4vps.eu/api/invoice/@id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/invoice/@id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/invoice/@id', auth=auth)
print(req.json())
Example Response:
{
    "invoice": {
        "id": "308976",
        "status": "Paid",
        "date": "2016-12-30",
        "duedate": "2017-01-06",
        "paybefore": "2017-01-06",
        "datepaid": "2016-12-30 12:40:47",
        "subtotal": 16.24,
        "credit": 0,
        "tax": 3.41,
        "taxrate": 21,
        "tax2": 0,
        "taxrate2": 0,
        "taxexempt": "0",
        "total": 19.65,
        "rate": 1,
        "rate2": 0,
        "rate3": 1,
        "notes": "",
        "items": [
            {
                "id": "12305",
                "invoice_id": "308976",
                "type": "Other",
                "item_id": "0",
                "description": "Example Service",
                "amount": "15.00",
                "taxed": "1",
                "qty": "1.00",
                "linetotal": "15.00"
            },
            {
                "id": "12309",
                "invoice_id": "308976",
                "type": "Other",
                "item_id": "-2",
                "description": "PayPal Payment Fee",
                "amount": "1.24",
                "taxed": "1",
                "qty": "1.00",
                "linetotal": "1.24"
            }
        ],
        "client": {
            "id": "26",
            "email": "api@example.com",
            "firstname": "Joe",
            "lastname": "Doe",
            "companyname": "",
            "address1": "Pretty View Lane",
            "address2": "3194",
            "city": "Santa Rosa",
            "state": "California",
            "postcode": "95401",
            "country": "US",
            "phonenumber": "+1.24123123"
        },
        "number": "2016\/12\/1",
        "currency": "USD"
    }
}

HTTP Request

GET /invoice/@id

Query Parameters

Parameter Type Description
id int

Payment Methods

List available payment methods

curl "https://billing.time4vps.eu/api/payment" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/payment', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/payment', auth=auth)
print(req.json())
Example Response:
{
    "payments": {
        "10": "BankTransfer",
        "9": "PayPal"
    }
}

HTTP Request

GET /payment

Support

List Tickets

List support tickets under my account

curl "https://billing.time4vps.eu/api/tickets" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/tickets', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/tickets', auth=auth)
print(req.json())
Example Response:
{
    "tickets": [
        {
            "client_read": "1",
            "ticket_number": "736633",
            "date": "2016-12-30 12:48:13",
            "deptname": "Billing",
            "subject": "Lore Ipsum",
            "status": "Open"
        }
    ]
}

HTTP Request

GET /tickets

Ticket details

Get ticket details, including all replies

curl "https://billing.time4vps.eu/api/tickets/@number" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/tickets/@number', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/tickets/@number', auth=auth)
print(req.json())
Example Response:
{
    "ticket": {
        "date": "2016-12-30 12:48:13",
        "ticket_number": "736633",
        "name": "Joe Doe",
        "email": "api@example.com",
        "subject": "Lore Ipsum",
        "body": "Donec sollicitudin molestie malesuada. \r\nSed porttitor lectus nibh. Vivamus magna justo, \r\nlacinia eget consectetur sed, convallis at tellus.",
        "status": "Answered",
        "client_read": "1",
        "deptname": "Billing"
    },
    "replies": [
        {
            "id": "929",
            "name": "Suppport Staff",
            "date": "2016-12-30 12:51:04",
            "body": "Vestibulum ac diam sit amet quam \r\nvehicula elementum sed sit amet dui. \r\nPraesent sapien massa\r\n\r\n-- Maecenas efficitur elit est --",
            "status": "Sent",
            "type": "Admin"
        }
    ]
}

HTTP Request

GET /tickets/@number

Query Parameters

Parameter Type Description
number int Ticket number

Domains

Get domain nameservers

Get domain nameservers

curl "https://billing.time4vps.eu/api/domain/@id/ns" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/ns', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/ns', auth=auth)
print(req.json())
Example Response:
{
    "domain_id": "1",
    "nameservers": [
            "dns1.name-services.com",
            "dns2.name-services.com",
            "dns3.name-services.com",
            "dns4.name-services.com",
            "dns5.name-services.com"
        ]
    }
}

HTTP Request

GET /domain/@id/ns

Query Parameters

Parameter Type Description
id int Domain id

Register domain nameserver

Register domain nameserver

curl "https://billing.time4vps.eu/api/domain/@id/reg" \
   -u user:pass \
   -d action="actionValue"\
   -d nameserver="nameserverValue"\
   -d ip="ipValue"\
   -d oldip="oldipValue"\
   -d newip="newipValue"
$data = array(
    'action' => 'actionValue',
    'nameserver' => 'nameserverValue',
    'ip' => 'ipValue',
    'oldip' => 'oldipValue',
    'newip' => 'newipValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/reg', array(), $data, $options);
echo $resp->body;
payload = {
    'action' : 'actionValue',
    'nameserver' : 'nameserverValue',
    'ip' : 'ipValue',
    'oldip' : 'oldipValue',
    'newip' : 'newipValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/reg', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "Register Name Server: Command completed successfully"
    ]
}

HTTP Request

PUT /domain/@id/reg

Query Parameters

Parameter Type Description
id int Domain id
action string Action. Values registerNameServer or modifyNameServer or deleteNameServer
nameserver string Name Server. Require for each action
ip string IP Address of Name Server. Require for registerNameServer action
oldip string Old IP Address of Name Server. Require for modifyNameServer action
newip string New IP Address of Name Server. Require for modifyNameServer action

Get domain EPP Code

Get domain EPP Code

curl "https://billing.time4vps.eu/api/domain/@id/epp" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/epp', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/epp', auth=auth)
print(req.json())
Example Response:
{
    "domain_id": "1",
    "epp_code": "123ExaMple"
}

HTTP Request

GET /domain/@id/epp

Query Parameters

Parameter Type Description
id int Domain id

Synchronize domain

Synchronize domain

curl "https://billing.time4vps.eu/api/domain/@id/sync" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/sync', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/sync', auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "success_changes_save"
    ]
}

HTTP Request

GET /domain/@id/sync

Query Parameters

Parameter Type Description
id int Domain id

Get domain lock

Get domain lock

curl "https://billing.time4vps.eu/api/domain/@id/reglock" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/reglock', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/reglock', auth=auth)
print(req.json())
Example Response:
{
    "success": true,
    "registrar_lock": 1,
}

HTTP Request

GET /domain/@id/reglock

Query Parameters

Parameter Type Description
id int Domain id

Update domain lock

Update domain lock

curl "https://billing.time4vps.eu/api/domain/@id/reglock" \
   -u user:pass \
   -d switch="switchValue"
$data = array(
    'switch' => 'switchValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/reglock', array(), $data, $options);
echo $resp->body;
payload = {
    'switch' : 'switchValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/reglock', data=payload, auth=auth)
print(req.json())
Example Response:
{
            "success" => true,
            "info" => [
                "Registrar Lock updated successfully.
            "]
    }

HTTP Request

PUT /domain/@id/reglock

Query Parameters

Parameter Type Description
id int Domain id
switch int Domain lock. Values 1 or 0

Update domain ID Protection

Update domain lock ID Protection

curl "https://billing.time4vps.eu/api/domain/@id/idprotection" \
   -u user:pass \
   -d switch="switchValue"
$data = array(
    'switch' => 'switchValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/idprotection', array(), $data, $options);
echo $resp->body;
payload = {
    'switch' : 'switchValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/idprotection', data=payload, auth=auth)
print(req.json())
Example Response:
{
            "success" => true,
            "info" => [
                "ID Protection updated successfully.
            "]
    }

HTTP Request

PUT /domain/@id/idprotection

Query Parameters

Parameter Type Description
id int Domain id
switch int ID Protection. Values 1 or 0

Get domain contact info

Get domain contact info

curl "https://billing.time4vps.eu/api/domain/@id/contact" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/contact', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/contact', auth=auth)
print(req.json())
Example Response:
{
    "domain_id": "1",
    "contact_info": {
        "registrant": {
            "firstname": "JH",
            "lastname": "Software",
            "companyname": "JH Software",
            "email": "john@example.com",
            "address1": "Th.Street 1",
            "address2": "",
            "city": "New York",
            "state": "New York",
            "postcode": "11-111",
            "country": "US",
            "phonenumber": "+1.123321123"
        },
        "tech": {
            "firstname": "JH",
            "lastname": "Software",
            "companyname": "JH Software",
            "email": "john@example.com",
            "address1": "Th.Street 1",
            "address2": "",
            "city": "New York",
            "state": "New York",
            "postcode": "11-111",
            "country": "US",
            "phonenumber": "+1.123321123"
        },
        "admin": {
            "firstname": "JH",
            "lastname": "Software",
            "companyname": "JH Software",
            "email": "john@example.com",
            "address1": "Th.Street 1",
            "address2": "",
            "city": "New York",
            "state": "New York",
            "postcode": "11-111",
            "country": "US",
            "phonenumber": "+1.123321123"
        },
        "billing": {
            "firstname": "JH",
            "lastname": "Software",
            "companyname": "JH Software",
            "email": "john@example.com",
            "address1": "Th.Street 1",
            "address2": "",
            "city": "New York",
            "state": "New York",
            "postcode": "11-111",
            "country": "US",
            "phonenumber": "+1.123321123"
        }
    }
}

HTTP Request

GET /domain/@id/contact

Query Parameters

Parameter Type Description
id int Domain id

Update domain contact info

Update domain contact info

curl "https://billing.time4vps.eu/api/domain/@id/contact" \
   -u user:pass \
   -d contact_info[key]="contact_infoValue"
$data = array(
    'contact_info' => array('key'=>'value')
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/contact', array(), $data, $options);
echo $resp->body;
payload = {
    'contact_info' : {'key':'value'}
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/contact', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "Contact Info has been updated"
    ]
}

HTTP Request

PUT /domain/@id/contact

Query Parameters

Parameter Type Description
id int Domain id
contact_info array Array with contact info that you want to update (http_build_query format). Structure the same as output from GET /domain/@id/contact

Get email forwarding

Get email forwarding

curl "https://billing.time4vps.eu/api/domain/@id/emforwarding" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/emforwarding', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/emforwarding', auth=auth)
print(req.json())
Example Response:
{
    "domain_id": "1",
    "email_forwarding": {
        "1": {
            "address": "test1",
            "forwardto": "test2@example.com"
        },
        "2": {
            "address": "test3",
            "forwardto": "test4@example.com"
        }
    }
}

HTTP Request

GET /domain/@id/emforwarding

Query Parameters

Parameter Type Description
id int Domain id

Update email forwarding

Update email forwarding

curl "https://billing.time4vps.eu/api/domain/@id/emforwarding" \
   -u user:pass \
   -d from="fromValue"\
   -d to="toValue"
$data = array(
    'from' => 'fromValue',
    'to' => 'toValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/emforwarding', array(), $data, $options);
echo $resp->body;
payload = {
    'from' : 'fromValue',
    'to' : 'toValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/emforwarding', data=payload, auth=auth)
print(req.json())

HTTP Request

PUT /domain/@id/emforwarding

Query Parameters

Parameter Type Description
id int Domain id
from string Forward from
to string Forward to

Update domain forwarding

Update domain forwarding

curl "https://billing.time4vps.eu/api/domain/@id/forwarding" \
   -u user:pass \
   -d destination_prefix="destination_prefixValue"\
   -d destination="destinationValue"\
   -d urlmasking="urlmaskingValue"\
   -d subdomainfwd="subdomainfwdValue"
$data = array(
    'destination_prefix' => 'destination_prefixValue',
    'destination' => 'destinationValue',
    'urlmasking' => 'urlmaskingValue',
    'subdomainfwd' => 'subdomainfwdValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/forwarding', array(), $data, $options);
echo $resp->body;
payload = {
    'destination_prefix' : 'destination_prefixValue',
    'destination' : 'destinationValue',
    'urlmasking' : 'urlmaskingValue',
    'subdomainfwd' : 'subdomainfwdValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/forwarding', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "info": [
        "success_changes_save"
    ]
}

HTTP Request

PUT /domain/@id/forwarding

Query Parameters

Parameter Type Description
id int Domain id
destination_prefix string Destination prefix. Values http:// or https://
destination string Destination
urlmasking int URL Masking. Values 1 or 0
subdomainfwd int Subdomain forwarding. Values 1 or 0

Get domain autorenew

Get domain autorenew

curl "https://billing.time4vps.eu/api/domain/@id/autorenew" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/domain/@id/autorenew', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/domain/@id/autorenew', auth=auth)
print(req.json())
Example Response:
{
    "success": true,
    "autorenew": 1
}

HTTP Request

GET /domain/@id/autorenew

Query Parameters

Parameter Type Description
id int Domain id

Enable/disable domain autorenew

Enable/disable domain autorenew

curl "https://billing.time4vps.eu/api/domain/@id/autorenew" \
   -u user:pass \
   -d autorenew="autorenewValue"
$data = array(
    'autorenew' => 'autorenewValue'
);
$resp = Requests::put('https://billing.time4vps.eu/api/domain/@id/autorenew', array(), $data, $options);
echo $resp->body;
payload = {
    'autorenew' : 'autorenewValue'
}
req = requests.put('https://billing.time4vps.eu/api/domain/@id/autorenew', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "success": true,
    "info": [
        "success_changes_save"
    ]
}

HTTP Request

PUT /domain/@id/autorenew

Query Parameters

Parameter Type Description
id int Domain id
autorenew int Renew. Values 1 or 0

Services

List services

List all services under your account

curl "https://billing.time4vps.eu/api/service" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/service', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/service', auth=auth)
print(req.json())
Example Response:
{
    "services": [
        {
            "id": "301",
            "domain": "examplename.com",
            "total": "9.99",
            "status": "Pending",
            "billingcycle": "Monthly",
            "next_due": "2017-12-30",
            "category": "Hosting",
            "category_url": "hosting",
            "name": "Starter Hosting"
        }
    ]
}

HTTP Request

GET /service

Service details

Return details for service @id

curl "https://billing.time4vps.eu/api/service/@id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/service/@id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/service/@id', auth=auth)
print(req.json())
Example Response:
{
    "service": {
        "id": "301",
        "date_created": "2016-12-30",
        "domain": "examplename.com",
        "firstpayment": "9.99",
        "total": "9.99",
        "billingcycle": "Monthly",
        "next_due": "2017-12-30",
        "next_invoice": "2017-01-27",
        "status": "Active",
        "label": "",
        "username": "examplen",
        "password": "pdtzc",
        "name": "Starter Hosting"
    }
}

HTTP Request

GET /service/@id

Query Parameters

Parameter Type Description
id int Service id

Upgrade Options

List upgrade options

curl "https://billing.time4vps.eu/api/service/@id/upgrade" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/service/@id/upgrade', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/service/@id/upgrade', auth=auth)
print(req.json())
Example Response:
{
    "resources": [
        {
            "id": 1557,
            "name": "Bandwidth",
            "type": "select",
            "items": [
                {
                    "id": "9953",
                    "name": "100 GB",
                    "price": 1,
                    "setup_price": 0,
                    "selected": true
                },
                {
                    "id": "10103",
                    "name": "500 GB",
                    "price": 5,
                    "setup_price": 0,
                    "selected": false
                },
                {
                    "id": "10104",
                    "name": "1 TB",
                    "price": 10,
                    "setup_price": 0,
                    "selected": false
                }
            ]
        }
    ],
    "package": []
}

HTTP Request

GET /service/@id/upgrade

Query Parameters

Parameter Type Description
id int

Upgrade Request

Estimate or request upgrade

// Format of ''resources'' paremeter
{
    "resource_id" : "qty_value", // sliders & qty fields
    "resource_id" : "item_id", // dropdown & radio fields
    "resource_id" : {
        "item_id": "qty_value" // dropdown with qty field
    }
}
curl "https://billing.time4vps.eu/api/service/@id/upgrade" \
   -u user:pass \
   -d resources[key]="resourcesValue"\
   -d package="packageValue"\
   -d cycle="cycleValue"\
   -d send="sendValue"
$data = array(
    'resources' => array('key'=>'value'),
    'package' => 'packageValue',
    'cycle' => 'cycleValue',
    'send' => 'sendValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/service/@id/upgrade', array(), $data, $options);
echo $resp->body;
payload = {
    'resources' : {'key':'value'},
    'package' : 'packageValue',
    'cycle' : 'cycleValue',
    'send' : 'sendValue'
}
req = requests.post('https://billing.time4vps.eu/api/service/@id/upgrade', data=payload, auth=auth)
print(req.json())

HTTP Request

POST /service/@id/upgrade

Query Parameters

Parameter Type Description
id int Service id
resources array array with resource values
package int New package id, optonal when upgrading resources
cycle string New billing cycle, optonal when upgrading resources
send boolean Set to true when you want to send your upgrade request

Cancel Service

Request service cancellation

curl "https://billing.time4vps.eu/api/service/@id/cancel" \
   -u user:pass \
   -d immediate="immediateValue"\
   -d reason="reasonValue"
$data = array(
    'immediate' => 'immediateValue',
    'reason' => 'reasonValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/service/@id/cancel', array(), $data, $options);
echo $resp->body;
payload = {
    'immediate' : 'immediateValue',
    'reason' : 'reasonValue'
}
req = requests.post('https://billing.time4vps.eu/api/service/@id/cancel', data=payload, auth=auth)
print(req.json())
Example Response:
{
  "info": [
    "cancell_sent"
  ]
}

HTTP Request

POST /service/@id/cancel

Query Parameters

Parameter Type Description
id int Service id
immediate string set to false to terminate service at the end of billing date, true - terminate immediately
reason string Reason for this request

Cart

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

List product categories

Return a list of product categories.

curl "https://billing.time4vps.eu/api/category" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/category', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/category', auth=auth)
print(req.json())
Example Response:
{
    "categories": [
        {
            "id": "10",
            "name": "Hosting",
            "description": "",
            "slug": "hosting"
        },
        {
            "id": "6",
            "name": "Domains",
            "description": "",
            "slug": "domains"
        },
        {
            "id": "16",
            "name": "Dedicated",
            "description": "",
            "slug": "dedicated"
        }
    ]
}

HTTP Request

GET /category

List products in category

Return a list of product available for purchase under requested category

curl "https://billing.time4vps.eu/api/category/@category_id/product" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/category/@category_id/product', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/category/@category_id/product', auth=auth)
print(req.json())
Example Response:
{
    "products": [
        {
            "id": "333",
            "type": "1",
            "name": "Starter Hosting",
            "stock": false,
            "paytype": "Regular",
            "description": "Disk:10GB
Memory:2GB
MySql:10 DB
Email:100 Users
", "qty": "0", "tags": [ ], "periods": [ { "title": "m", "value": "m", "price": 9.99, "setup": 0, "selected": true }, { "title": "a", "value": "a", "price": 109.89, "setup": 0, "selected": false }, { "title": "b", "value": "b", "price": 199.8, "setup": 0, "selected": false }, { "title": "t", "value": "t", "price": 299.7, "setup": 0, "selected": false } ] }, (...) ] }

HTTP Request

GET /category/@category_id/product

Query Parameters

Parameter Type Description
category_id int Category ID

Get product configuration details

Return product details with form configuration, addons and subproducts if available.

curl "https://billing.time4vps.eu/api/order/@product_id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/order/@product_id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/order/@product_id', auth=auth)
print(req.json())
Example Response:
{
    "product": {
        "id": "333",
        "category_name": "Hosting",
        "category_id": "49",
        "name": "Starter Hosting",
        "price": 9.99,
        "recurring": "m",
        "setup": 0,
        "config": {
            "product": [
                {
                    "type": "select",
                    "title": "pickcycle",
                    "id": "cycle",
                    "name": "cycle",
                    "items": [
                        {
                            "title": "m",
                            "value": "m",
                            "price": 9.99,
                            "setup": 0,
                            "selected": true
                        },
                        {
                            "title": "a",
                            "value": "a",
                            "price": 109.89,
                            "setup": 0,
                            "selected": false
                        },
                        {
                            "title": "b",
                            "value": "b",
                            "price": 199.8,
                            "setup": 0,
                            "selected": false
                        },
                        {
                            "title": "t",
                            "value": "t",
                            "price": 299.7,
                            "setup": 0,
                            "selected": false
                        }
                    ],
                    "value": "m",
                    "price": 9.99,
                    "setup": 0
                },
                {
                    "type": "input",
                    "title": "domain",
                    "id": "domain",
                    "name": "domain",
                    "value": null
                }
            ],
            "forms": [
                {
                    "type": "select",
                    "title": "Disk Size",
                    "id": "1618",
                    "firstItemId": 10330,
                    "description": "",
                    "name": "custom[1618]",
                    "required": false,
                    "multiple": false,
                    "config": {
                        "conditionals": []
                    },
                    "value": [],
                    "textvalue": [],
                    "price": 0,
                    "recurring_price": 0,
                    "setup": 0,
                    "prorata_date": null,
                    "items": [
                        {
                            "title": "512MB",
                            "value": 1,
                            "id": 10330,
                            "price": 0,
                            "setup": 0,
                            "selected": false
                        },
                        {
                            "title": "1GB",
                            "value": 1,
                            "id": 10331,
                            "price": 0,
                            "setup": 0,
                            "selected": false
                        },
                        {
                            "title": "2GB",
                            "value": 1,
                            "id": 10332,
                            "price": 0,
                            "setup": 0,
                            "selected": false
                        }
                    ]
                },
                (...)
            ],
            "addons": [
                {
                    "type": "subitem",
                    "title": "Cpanel2: Add Extra IP",
                    "id": "31",
                    "value": null,
                    "description": "Automatically adds IP address to account",
                    "config": [
                        {
                            "type": "checkbox",
                            "title": "add",
                            "name": "addon[31]",
                            "checked": false
                        },
                        {
                            "type": "select",
                            "title": "billingcycle",
                            "name": "addon_cycles[31]",
                            "items": [
                                {
                                    "title": "m",
                                    "value": "m",
                                    "price": 5,
                                    "setup": 0,
                                    "selected": true
                                },
                                {
                                    "title": "q",
                                    "value": "q",
                                    "price": 20,
                                    "setup": 0,
                                    "selected": false
                                },
                                {
                                    "title": "a",
                                    "value": "a",
                                    "price": 50,
                                    "setup": 0,
                                    "selected": false
                                }
                            ]
                        }
                    ],
                    "price": 0,
                    "recurring_price": 0,
                    "setup": 0,
                    "prorata_date": null
                },
                (...)
            ],
            "subproducts": []
        },
        "recurring_price": 9.99,
        "prorata_date": null
    }
}

HTTP Request

GET /order/@product_id

Query Parameters

Parameter Type Description
product_id int Product ID

Order new service

Create and submit new order for selected product.

To get available cycle and configuration options lookup product details using GET /order/@product_id

For whitelabel server use 'serverhost.name' for a domain parameter.

curl "https://billing.time4vps.eu/api/order/@product_id" \
   -u user:pass \
   -d domain="domainValue"\
   -d cycle="cycleValue"\
   -d pay_method="pay_methodValue"\
   -d custom[key]="customValue"
$data = array(
    'domain' => 'domainValue',
    'cycle' => 'cycleValue',
    'pay_method' => 'pay_methodValue',
    'custom' => array('key'=>'value')
);
$resp = Requests::post('https://billing.time4vps.eu/api/order/@product_id', array(), $data, $options);
echo $resp->body;
payload = {
    'domain' : 'domainValue',
    'cycle' : 'cycleValue',
    'pay_method' : 'pay_methodValue',
    'custom' : {'key':'value'}
}
req = requests.post('https://billing.time4vps.eu/api/order/@product_id', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "order_num": 873340995,
    "invoice_id": "308979",
    "total": "9.99"
}

HTTP Request

POST /order/@product_id

Query Parameters

Parameter Type Description
product_id int Product ID
domain string Domain name, ie. example.com, may be optional
cycle string Billing period symbol
pay_method int Payment method ID
custom array Additional options data available for sop products

Get available VPS servers

curl "https://billing.time4vps.eu/api/category/available/vps" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/category/available/vps', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/category/available/vps', auth=auth)
print(req.json())
Example Response:
[
    {
        "id": 0,
        "name": "Linux",
        "description": "
  • CPU: ...<\/li><\/ul>" } ]

HTTP Request

GET /category/available/vps

Server Management

Server management API lets you retrieve your active server information and manage them. All management tasks are asynchronous. This means called method will only initiate task and will return result of task initiation. If task initiation was unsuccessfull, error message will be returned. Task id is used to query Task Result method to retrieve task result. For more info see documentation of Task Result method.

For example to reboot server, you must initiate task by calling POST /server/@id/reboot. If task initiated successfully, you'll receive task_id parameter, which must be provided in GET /server/@server_id/task/@task_id call, to receive task results.

You can run one task per server at a time.

List All Servers

Lists all active servers. Results includes only the brief information about the server.

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server', auth=auth)
print(req.json())
Example Response:
{
    "server_id": 12,
    "domain": "server.domain.name",
    "date_created": "2017-01-31",
    "synch_date": "2017-01-31 15:35:00",
    "label": "Data Server",
    "type": "OpenVZ"
}

HTTP Request

GET /server

Server Details

Particular server details: configuration, installed OS, resource usage and etc.

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server/@server_id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server/@server_id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server/@server_id', auth=auth)
print(req.json())
Example Response:
{
    "synch_date": "2017-01-31",
    "domain": "server.domain.name",
    "label": "Data Server",
    "status": "Active",
    "cpu_frequency": 862,
    "cpu_cores": 2,
    "ram_limit": 286,
    "ram_used": 59,
    "disk_limit": 287,
    "disk_usage": 294,
    "bw_limit": 6308,
    "bw_in": 320,
    "bw_out": 560,
    "os": "ubuntu-16.04-x86_64",
    "ip": "123.123.123.123",
    "additional_ip": [
        "124.124.124.124",
        "125.125.125.125"
    ]
}

HTTP Request

GET /server/@server_id

Query Parameters

Parameter Type Description
server_id int Server ID

Task Result

Returns task result by given task ID, all dates are in ISO 8601 format:

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server/@server_id/task/@task_id" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server/@server_id/task/@task_id', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server/@server_id/task/@task_id', auth=auth)
print(req.json())
Example Response:
{
    "activated": "2018-05-31T10:25:24+00:00",
    "assigned": "2018-05-31T10:26:24+00:00",
    "completed": "2018-05-31T10:27:24+00:00",
    "results": "VM rebooted successfully"
}

HTTP Request

GET /server/@server_id/task/@task_id

Query Parameters

Parameter Type Description
server_id int Server ID
task_id int Task ID

Reboot

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/reboot" \
   -u user:pass \
$data = array(
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/reboot', array(), $data, $options);
echo $resp->body;
payload = {
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/reboot', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 120063
}

HTTP Request

POST /server/@server_id/reboot

Query Parameters

Parameter Type Description
server_id int Server ID

Re-Install

Available OS'es can be obtained with GET /server/@server_id/oses call.

All data in the server will be lost! All of our backups / snapshots of your server will be deleted from our storages!

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/reinstall" \
   -u user:pass \
   -d os="osValue"
$data = array(
    'os' => 'osValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/reinstall', array(), $data, $options);
echo $resp->body;
payload = {
    'os' : 'osValue'
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/reinstall', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 92521
}

HTTP Request

POST /server/@server_id/reinstall

Query Parameters

Parameter Type Description
server_id int Server ID
os string Operating System (required)

Reset Password

Resets privileged user password

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/resetpassword" \
   -u user:pass \
$data = array(
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/resetpassword', array(), $data, $options);
echo $resp->body;
payload = {
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/resetpassword', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 56347
}

HTTP Request

POST /server/@server_id/resetpassword

Query Parameters

Parameter Type Description
server_id int Server ID

Launch Web Console

Web Console should be used for emergency access only!

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/webconsole" \
   -u user:pass \
   -d timeout="timeoutValue"\
   -d whitelabel="whitelabelValue"
$data = array(
    'timeout' => 'timeoutValue',
    'whitelabel' => 'whitelabelValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/webconsole', array(), $data, $options);
echo $resp->body;
payload = {
    'timeout' : 'timeoutValue',
    'whitelabel' : 'whitelabelValue'
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/webconsole', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 4479
}

HTTP Request

POST /server/@server_id/webconsole

Query Parameters

Parameter Type Description
server_id int Server ID
timeout string Timeout in hours (required, valid values: '1h', '3h', '6h', '12h', '24h')
whitelabel bool Should result return white-labeled VNC host (required, valid values: 'true', 'false')

Change Hostname

Changes the hostname of your server. Hostname must pointed to your server main IP address.

Note: Full DNS record propagation can take up to 48 hours.

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/rename" \
   -u user:pass \
   -d hostname="hostnameValue"
$data = array(
    'hostname' => 'hostnameValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/rename', array(), $data, $options);
echo $resp->body;
payload = {
    'hostname' : 'hostnameValue'
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/rename', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 45496
}

HTTP Request

POST /server/@server_id/rename

Query Parameters

Parameter Type Description
server_id int Server ID
hostname string New hostname (required, must be pointed to server IP)

Change PTR Record

Changes PTR record for the additional IP (if server has more than one IPv4 address).

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/changeptr" \
   -u user:pass \
   -d ip_address="ip_addressValue"\
   -d hostname="hostnameValue"
$data = array(
    'ip_address' => 'ip_addressValue',
    'hostname' => 'hostnameValue'
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/changeptr', array(), $data, $options);
echo $resp->body;
payload = {
    'ip_address' : 'ip_addressValue',
    'hostname' : 'hostnameValue'
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/changeptr', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 108347
}

HTTP Request

POST /server/@server_id/changeptr

Query Parameters

Parameter Type Description
server_id int Server ID
ip_address string IP Address to change PTR (required)
hostname string Hostname (required)

Flush IPTables / Firewall

Restores to defaults your server`s firewall settings.

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/flushfirewall" \
   -u user:pass \
$data = array(
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/flushfirewall', array(), $data, $options);
echo $resp->body;
payload = {
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/flushfirewall', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 107294
}

HTTP Request

POST /server/@server_id/flushfirewall

Query Parameters

Parameter Type Description
server_id int Server ID

Change DNS Servers

Changes the DNS servers for your server.

At least 1 DNS servers muste be provided.

Call is asynchronous - task ID is returned.

curl "https://billing.time4vps.eu/api/server/@server_id/changedns" \
   -u user:pass \
   -d ns1="ns1Value"\
   -d ns2="ns2Value"\
   -d ns3="ns3Value"\
   -d ns4="ns4Value"
$data = array(
    'ns1' => 'ns1Value',
    'ns2' => 'ns2Value',
    'ns3' => 'ns3Value',
    'ns4' => 'ns4Value'
);
$resp = Requests::post('https://billing.time4vps.eu/api/server/@server_id/changedns', array(), $data, $options);
echo $resp->body;
payload = {
    'ns1' : 'ns1Value',
    'ns2' : 'ns2Value',
    'ns3' : 'ns3Value',
    'ns4' : 'ns4Value'
}
req = requests.post('https://billing.time4vps.eu/api/server/@server_id/changedns', data=payload, auth=auth)
print(req.json())
Example Response:
{
    "task_id": 139769
}

HTTP Request

POST /server/@server_id/changedns

Query Parameters

Parameter Type Description
server_id int Server ID
ns1 string Nameserver 1 IP address (required)
ns2 string Nameserver 2 IP address (recommended)
ns3 string Nameserver 3 IP address (optional)
ns4 string Nameserver 4 IP address (optional)

Available OS List

List of available OS templates for a server.

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server/@server_id/oses" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server/@server_id/oses', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server/@server_id/oses', auth=auth)
print(req.json())
Example Response:
[
    {
        "os": "centos-7-x86_64",
        "title": "Centos 7"
    }
]

HTTP Request

GET /server/@server_id/oses

Query Parameters

Parameter Type Description
server_id int Server ID

Get Usage Graphs

Image link is valid only for short period of time, around 5-10 minutes.

Images shows the graphics of the main resource usage (Daily, Weekly, Monthly..)

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server/@server_id/graphs" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server/@server_id/graphs', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server/@server_id/graphs', auth=auth)
print(req.json())
Example Response:
[
    {
        "type": "cpu_daily",
        "url": "\/\/...\/graph.php?...VrBFovT0mOE0OZFwNrUf"
    }
]

HTTP Request

GET /server/@server_id/graphs

Query Parameters

Parameter Type Description
server_id int Server ID

Get Usage History

Displays the bandwidth usage of a server.

Call is synchronous - result returned immediately.

curl "https://billing.time4vps.eu/api/server/@server_id/history" \
   -u user:pass 
$resp = Requests::get('https://billing.time4vps.eu/api/server/@server_id/history', array(), $options);
echo $resp->body;
req = requests.get('https://billing.time4vps.eu/api/server/@server_id/history', auth=auth)
print(req.json())
Example Response:
[
    {
        "year": 2015,
        "month": 8,
        "bw_in": 8440,
        "bw_out": 10298
    }
]

HTTP Request

GET /server/@server_id/history

Query Parameters

Parameter Type Description
server_id int Server ID