NAV
DanskHosting
bash php python

Introduction

GITC 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.

Swagger Doc: You can download or display the JSON to generate documentation in Swagger.

Authentication

JSON Web Token Authentication

curl 'https://api.gitc.dk/api/login' \
    -d username="username"\
    -d password="password"

# grab authentication token from the response and pass it in Authorization header
curl 'https://api.gitc.dk/api/details' \
    -H "Authorization: Bearer $token"
$resp = $client->post('login', [
    'form_params' => [
        'username' => 'username',
        'password' => 'password'
    ]
]);

$token = $resp->json()['token'];

$resp = $client->get('details', [
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

echo $resp->getBody();
payload = username
resp = requests.post('https://api.gitc.dk/api/login', data=payload)

headers = {
    'Authorization': 'Bearer ' + req.json().token
}
resp = requests.get('https://api.gitc.dk/api/details', headers=headers)
print(resp)

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

To authenticate, you need to send a JSON Web Token (JWT) in the authorization header of the HTTP request.

To obtain the authorization token you need to submit a request with your username and password to POST https://api.gitc.dk/api/login API method

All API calls that require authentication expect HTTP header in the form of Authorization: Bearer <token>.

For example:
Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc...

Clientarea

Login

Generate new authorization token

POST_DATA="{
    \"username\": \"user@example.com\",
    \"password\": \"secret\"
}"

curl -X POST "https://api.gitc.dk/api/login" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
]);

$options = [
    'json' => [
        "username" => "user@example.com",
        "password" => "secret"
    ]
]
$resp = $client->post('login', $options);
echo $resp->getBody();
payload = {
    'username': "user@example.com",
    'password': "secret"
}


req = requests.post('https://api.gitc.dk/api/login', json=payload)
print(req.json())
Example Response:
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHRw(...)5lZ9T79ft9uwOkqRRmIBbtR51_w",
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiIzMD(...)ChwIAb3zvxBu6kvULa2AwAt9U-I"
}

HTTP Request

POST /login

Query Parameters

Parameter Type Description
username string

Your acount email address

password string

Account password

Logout

Invalidate authorization token


curl -X POST "https://api.gitc.dk/api/logout" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->post('logout');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/logout', headers=headers)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

POST /logout

Refresh Token

Generate new authorization token using refresh token

POST_DATA="{
    \"refresh_token\": \"refresh_tokenValue\"
}"

curl -X POST "https://api.gitc.dk/api/token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
]);

$options = [
    'json' => [
        "refresh_token" => "refresh_tokenValue"
    ]
]
$resp = $client->post('token', $options);
echo $resp->getBody();
payload = {
    'refresh_token': "refresh_tokenValue"
}


req = requests.post('https://api.gitc.dk/api/token', json=payload)
print(req.json())
Example Response:
{
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJpc3MiOiJodHR(...)vY2xlYiHGvauCWZD9B0VwXgHEzXDllqY",
    "refresh": "eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJzdWIiOiJBQ(...)Rmivc_u3YA_kgDqOPtUuGNXOzueXYtZw"
}

HTTP Request

POST /token

Query Parameters

Parameter Type Description
refresh_token string

Refresh token previously obtained from POST /login

Revoke Token

Invalidate authorization and refresh token. Pass refresh token or call this method with valid access token

POST_DATA="{
    \"refresh_token\": \"refresh_tokenValue\"
}"

curl -X POST "https://api.gitc.dk/api/revoke" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
]);

$options = [
    'json' => [
        "refresh_token" => "refresh_tokenValue"
    ]
]
$resp = $client->post('revoke', $options);
echo $resp->getBody();
payload = {
    'refresh_token': "refresh_tokenValue"
}


req = requests.post('https://api.gitc.dk/api/revoke', json=payload)
print(req.json())
Example Response:
{
    "status": true
}

HTTP Request

POST /revoke

Query Parameters

Parameter Type Description
refresh_token string

User Details

Return registration details for my account


curl -X GET "https://api.gitc.dk/api/details" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('details');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/details', headers=headers)
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

POST_DATA="{
    \"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\"
}"

curl -X PUT "https://api.gitc.dk/api/details" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "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"
    ]
]
$resp = $client->put('details', $options);
echo $resp->getBody();
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"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/details', json=payload, headers=headers)
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
type string

Account Type

Available values: Private, Company.

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

User Logs

Returns logs from history


curl -X GET "https://api.gitc.dk/api/logs" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('logs');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/logs', headers=headers)
print(req.json())

HTTP Request

GET /logs

Get Affiliate summary


curl -X GET "https://api.gitc.dk/api/affiliates/summary" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/summary');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/summary', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/summary

Get Affiliate campaigns


curl -X GET "https://api.gitc.dk/api/affiliates/campaigns" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/campaigns');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/campaigns', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/campaigns

Get Affiliate commissions


curl -X GET "https://api.gitc.dk/api/affiliates/commissions" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/commissions');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/commissions', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/commissions

Get Affiliate payouts


curl -X GET "https://api.gitc.dk/api/affiliates/payouts" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/payouts');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/payouts', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/payouts

Get Affiliate vouchers


curl -X GET "https://api.gitc.dk/api/affiliates/vouchers" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/vouchers');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/vouchers', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/vouchers

Get Affiliate commission plans


curl -X GET "https://api.gitc.dk/api/affiliates/commissionplans" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('affiliates/commissionplans');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/affiliates/commissionplans', headers=headers)
print(req.json())

HTTP Request

GET /affiliates/commissionplans

List contacts

Return a list of contacts on this account


curl -X GET "https://api.gitc.dk/api/contact" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('contact');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/contact', headers=headers)
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

Add contact

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

POST_DATA="{
    \"password\": \"passwordValue\",
    \"privileges\": \"privilegesValue\",
    \"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\"
}"

curl -X POST "https://api.gitc.dk/api/contact" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "password" => "passwordValue",
        "privileges" => "privilegesValue",
        "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"
    ]
]
$resp = $client->post('contact', $options);
echo $resp->getBody();
payload = {
    'password': "passwordValue",
    'privileges': "privilegesValue",
    '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"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/contact', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "contact_id": "1",        
    "info": [
        "profile_added"
    ]
}

HTTP Request

POST /contact

Query Parameters

Parameter Type Description
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

type string

Account Type

Available values: Private, Company.

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

Contact privileges

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


curl -X GET "https://api.gitc.dk/api/contact/privileges" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('contact/privileges');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/contact/privileges', headers=headers)
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 -X GET "https://api.gitc.dk/api/contact/@id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('contact/@id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/contact/@id', headers=headers)
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`

POST_DATA="{
    \"id\": \"idValue\",
    \"privileges\": \"privilegesValue\",
    \"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\"
}"

curl -X PUT "https://api.gitc.dk/api/contact/@id" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue",
        "privileges" => "privilegesValue",
        "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"
    ]
]
$resp = $client->put('contact/@id', $options);
echo $resp->getBody();
payload = {
    'id': "idValue",
    'privileges': "privilegesValue",
    '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"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/contact/@id', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "info": [
        "profile_updated"
    ]
}

HTTP Request

PUT /contact/@id

Query Parameters

Parameter Type Description
id int

Contact ID

privileges array

Array with privileges that you want to enable. Formatted the same way as output from GET /contact/privileges

type string

Account Type

Available values: Private, Company.

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

List all portal notifications

Return a list of all portal notifications.


curl -X GET "https://api.gitc.dk/api/notifications" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('notifications');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/notifications', headers=headers)
print(req.json())

HTTP Request

GET /notifications

Query Parameters

Parameter Type Description
rel_type string

Optional, return only by relation type

rel_id string

Optional, return only by relation id

List new portal notifications

Return only new portal notifications.


curl -X GET "https://api.gitc.dk/api/notifications/new" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('notifications/new');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/notifications/new', headers=headers)
print(req.json())

HTTP Request

GET /notifications/new

Query Parameters

Parameter Type Description
rel_type string

Optional, return only by relation type

rel_id string

Optional, return only by relation id

Acknowledge notification

Marks the notification as read


curl -X PUT "https://api.gitc.dk/api/notifications/@id/ack" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->put('notifications/@id/ack');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/notifications/@id/ack', headers=headers)
print(req.json())

HTTP Request

PUT /notifications/@id/ack

Billing

Account balance

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


curl -X GET "https://api.gitc.dk/api/balance" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('balance');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/balance', headers=headers)
print(req.json())
Example Response:
{
    {
        "success": true,
        "details": {
            "currency": "USD",
            "acc_balance": "123456.55",
            "acc_credit": "0.00"
        }
    }
}

HTTP Request

GET /balance

List Invoices

List all invoices under my account


curl -X GET "https://api.gitc.dk/api/invoice" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('invoice');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/invoice', headers=headers)
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 -X GET "https://api.gitc.dk/api/invoice/@id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('invoice/@id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/invoice/@id', headers=headers)
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

Apply credit

Apply account credit to invoice

POST_DATA="{
    \"amount\": \"amountValue\"
}"

curl -X POST "https://api.gitc.dk/api/invoice/@id/credit" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "amount" => "amountValue"
    ]
]
$resp = $client->post('invoice/@id/credit', $options);
echo $resp->getBody();
payload = {
    'amount': "amountValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/invoice/@id/credit', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "success": true,
    "invoice_status": "Paid",
    "applied": 2.1
}

HTTP Request

POST /invoice/@id/credit

Query Parameters

Parameter Type Description
amount number

Optional credit amount, when no value is specified maximum amount to fully pay the invoice will be used

Payment Methods

List available payment methods


curl -X GET "https://api.gitc.dk/api/payment" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('payment');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/payment', headers=headers)
print(req.json())
Example Response:
{
    "payments": {
        "10": "BankTransfer",
        "9": "PayPal"
    }
}

HTTP Request

GET /payment

Payment Methods Fees

List available payment methods with fees


curl -X GET "https://api.gitc.dk/api/payment/fees" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('payment/fees');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/payment/fees', headers=headers)
print(req.json())
Example Response:
{
    "payments": [
        {
            "id": 1,
            "name": "Bank Transfer",
            "fixed_fee": "0.0",
            "percent_fee": "0.0",
        },
        {
            "id": 2,
            "name": "Stripe",
            "fixed_fee": "0.5",
            "percent_fee": "2.9",
        },
        {
            "id": 4,
            "name": "Credit Card",
            "fixed_fee": "0.1",
            "percent_fee": "2.4"
        },
        {
            "id": 5,
            "name": "PayPal",
            "fixed_fee": "0.3",
            "percent_fee": "2.9"
        }
    ]
}

HTTP Request

GET /payment/fees

Services

List services

List all services under your account


curl -X GET "https://api.gitc.dk/api/service" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service', headers=headers)
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 -X GET "https://api.gitc.dk/api/service/@id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id', headers=headers)
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

List service methods

List methods available for service


curl -X GET "https://api.gitc.dk/api/service/@id/methods" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/methods');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/methods', headers=headers)
print(req.json())
Example Response:
{
    "methods": [
        {
            "name": "Upgrade Request",
            "method": "POST",
            "route": "\/service\/@id\/upgrade"
        },
        {
            "name": "Upgrade Options",
            "method": "GET",
            "route": "\/service\/@id\/upgrade"
        },
        {
            "name": "Change service label",
            "method": "POST",
            "route": "\/service\/@id\/label"
        },
        {
            "name": "Service label",
            "method": "GET",
            "route": "\/service\/@id\/label"
        },
        {
            "name": "Cancel Service",
            "method": "POST",
            "route": "\/service\/@id\/cancel"
        }
    ]
}

HTTP Request

GET /service/@id/methods

Upgrade Options

List upgrade options


curl -X GET "https://api.gitc.dk/api/service/@id/upgrade" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/upgrade');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/upgrade', headers=headers)
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

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
    }
}
POST_DATA="{
    \"id\": \"idValue\",
    \"resources\": \"resourcesValue\",
    \"package\": \"packageValue\",
    \"cycle\": \"cycleValue\",
    \"send\": \"sendValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/upgrade" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue",
        "resources" => "resourcesValue",
        "package" => "packageValue",
        "cycle" => "cycleValue",
        "send" => "sendValue"
    ]
]
$resp = $client->post('service/@id/upgrade', $options);
echo $resp->getBody();
payload = {
    'id': "idValue",
    'resources': "resourcesValue",
    'package': "packageValue",
    'cycle': "cycleValue",
    'send': "sendValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/upgrade', json=payload, headers=headers)
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

POST_DATA="{
    \"id\": \"idValue\",
    \"immediate\": \"immediateValue\",
    \"reason\": \"reasonValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/cancel" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue",
        "immediate" => "immediateValue",
        "reason" => "reasonValue"
    ]
]
$resp = $client->post('service/@id/cancel', $options);
echo $resp->getBody();
payload = {
    'id': "idValue",
    'immediate': "immediateValue",
    'reason': "reasonValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/cancel', json=payload, headers=headers)
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

Service label

Show current service label


curl -X GET "https://api.gitc.dk/api/service/@id/label" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/label');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/label', headers=headers)
print(req.json())
Example Response:
{
    "label": "example"
}

HTTP Request

GET /service/@id/label

Query Parameters

Parameter Type Description
id int

Service id

Change service label

Set new custom label to identify this service

POST_DATA="{
    \"id\": \"idValue\",
    \"label\": \"labelValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/label" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue",
        "label" => "labelValue"
    ]
]
$resp = $client->post('service/@id/label', $options);
echo $resp->getBody();
payload = {
    'id': "idValue",
    'label': "labelValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/label', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "success": true,
    "info": [
        "label_updated"
    ]
}

HTTP Request

POST /service/@id/label

Query Parameters

Parameter Type Description
id int

Service id

label string

New label

Manual Service Renew

Generate an invoice to renew the service.

POST_DATA="{
    \"id\": \"idValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/renew" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue"
    ]
]
$resp = $client->post('service/@id/renew', $options);
echo $resp->getBody();
payload = {
    'id': "idValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/renew', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "status": true,
    "invoice_id": "504426",
    "info": [
        "manualrenew_ok"
    ]
}

HTTP Request

POST /service/@id/renew

Query Parameters

Parameter Type Description
id int

Service id

List Billing Cycle

Get recurring billing cycle options


curl -X GET "https://api.gitc.dk/api/service/@id/cycle" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/cycle');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/cycle', headers=headers)
print(req.json())
Example Response:
{
    "current": "m",
    "cycles": {
        "m": "14.95",
        "a": "179.40",
        "b": "358.80"
    }
}

HTTP Request

GET /service/@id/cycle

Query Parameters

Parameter Type Description
id int

Service id

Change Billing Cycle

Change recurring billing cycle for the service

POST_DATA="{
    \"id\": \"idValue\",
    \"cycle\": \"cycleValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/cycle" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "id" => "idValue",
        "cycle" => "cycleValue"
    ]
]
$resp = $client->post('service/@id/cycle', $options);
echo $resp->getBody();
payload = {
    'id': "idValue",
    'cycle': "cycleValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/cycle', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "success": true,
    "info": [
        "changebillingcycle_ok"
    ]
}

HTTP Request

POST /service/@id/cycle

Query Parameters

Parameter Type Description
id int

Service id

cycle string

New billing cycle

List VMs

List virtual servers


curl -X GET "https://api.gitc.dk/api/service/@id/vms" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms

Get VM Details

Get the details of a particular virtual server


curl -X GET "https://api.gitc.dk/api/service/@id/vms/@vmid" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms/@vmid');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms/@vmid', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Create VM

Add new virtual server

POST_DATA="{
    \"label\": \"labelValue\",
    \"template\": \"templateValue\",
    \"memory\": \"memoryValue\",
    \"cpu\": \"cpuValue\",
    \"disk\": \"diskValue\",
    \"interface\": \"interfaceValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "label" => "labelValue",
        "template" => "templateValue",
        "memory" => "memoryValue",
        "cpu" => "cpuValue",
        "disk" => "diskValue",
        "interface" => "interfaceValue"
    ]
]
$resp = $client->post('service/@id/vms', $options);
echo $resp->getBody();
payload = {
    'label': "labelValue",
    'template': "templateValue",
    'memory': "memoryValue",
    'cpu': "cpuValue",
    'disk': "diskValue",
    'interface': "interfaceValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms

Query Parameters

Parameter Type Description
label string

VM label

template string

Template ID

memory string

Amount of RAM memory in MB

cpu string

Amount of CPU cores

disk string

Disk Space in GB

interface array

Interface configuration

Destroy VM

Remove virtual server


curl -X DELETE "https://api.gitc.dk/api/service/@id/vms/@vmid" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->delete('service/@id/vms/@vmid');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.delete('https://api.gitc.dk/api/service/@id/vms/@vmid', headers=headers)
print(req.json())

HTTP Request

DELETE /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Resize VM

Edit a virtual server

POST_DATA="{
    \"vmid\": \"vmidValue\",
    \"memory\": \"memoryValue\",
    \"cpu\": \"cpuValue\"
}"

curl -X PUT "https://api.gitc.dk/api/service/@id/vms/@vmid" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue",
        "memory" => "memoryValue",
        "cpu" => "cpuValue"
    ]
]
$resp = $client->put('service/@id/vms/@vmid', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue",
    'memory': "memoryValue",
    'cpu': "cpuValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/service/@id/vms/@vmid', json=payload, headers=headers)
print(req.json())

HTTP Request

PUT /service/@id/vms/@vmid

Query Parameters

Parameter Type Description
vmid string

Virtual server id

memory string

Amount of RAM in MB

cpu string

Amount of CPU cores

Stop VM

Stop virtual server

POST_DATA="{
    \"vmid\": \"vmidValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/stop" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/stop', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/stop', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/stop

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Start VM

Start virtual server

POST_DATA="{
    \"vmid\": \"vmidValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/start" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/start', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/start', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/start

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Shutdown VM

Perform graceful shutdown

POST_DATA="{
    \"vmid\": \"vmidValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/shutdown" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/shutdown', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/shutdown', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/shutdown

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Reboot VM

Reboot virtual server

POST_DATA="{
    \"vmid\": \"vmidValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/reboot" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/reboot', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/reboot', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/reboot

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Reset VM

Reset virtual server power

POST_DATA="{
    \"vmid\": \"vmidValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/reset" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "vmid" => "vmidValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/reset', $options);
echo $resp->getBody();
payload = {
    'vmid': "vmidValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/reset', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/reset

Query Parameters

Parameter Type Description
vmid string

Virtual server id

Change VM Hostname

Update virtual machine hostname

POST_DATA="{
    \"hostname\": \"hostnameValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/hostname" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "hostname" => "hostnameValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/hostname', $options);
echo $resp->getBody();
payload = {
    'hostname': "hostnameValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/hostname', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/hostname

Query Parameters

Parameter Type Description
hostname string

New hostname for the VM

Rebuild VM

Rebuild server, you can get list of templates supported by this server using '''/service/$id/templates'''

POST_DATA="{
    \"template\": \"templateValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/rebuild" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "template" => "templateValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/rebuild', $options);
echo $resp->getBody();
payload = {
    'template': "templateValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/rebuild', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/rebuild

Query Parameters

Parameter Type Description
template string

Template ID

List IPs

List virtual machine IPs


curl -X GET "https://api.gitc.dk/api/service/@id/vms/@vmid/ips" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms/@vmid/ips');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms/@vmid/ips', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/ips

Query Parameters

Parameter Type Description
type string

ipv4 or ipv6

iface int

Interface number [optional]

bridge string

Bridge name [optional, ignored if interface provided]

List IP Pools

List IP pools for a specific interface or network bridge


curl -X GET "https://api.gitc.dk/api/service/@id/vms/@vmid/ippool" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms/@vmid/ippool');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms/@vmid/ippool', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/ippool

Query Parameters

Parameter Type Description
iface int

Interface number [optional]

bridge string

Bridge name [optional, ignored if interface provided]

Allocate IPs

Allocate new IP for network interface.

POST_DATA="{
    \"pool\": \"poolValue\",
    \"type\": \"typeValue\",
    \"iface\": \"ifaceValue\",
    \"bridge\": \"bridgeValue\",
    \"number\": \"numberValue\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/ippool/@pool" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "pool" => "poolValue",
        "type" => "typeValue",
        "iface" => "ifaceValue",
        "bridge" => "bridgeValue",
        "number" => "numberValue"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/ippool/@pool', $options);
echo $resp->getBody();
payload = {
    'pool': "poolValue",
    'type': "typeValue",
    'iface': "ifaceValue",
    'bridge': "bridgeValue",
    'number': "numberValue"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/ippool/@pool', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/ippool/@pool

Query Parameters

Parameter Type Description
pool string|int

List ID to allocate new IP from

type string

ipv4 or ipv6

iface int

Interface number

bridge string

Bridge name [optional, ignored if interface provided]

number int

Number of IPs to allocate

List available networks

List of networks and IP pools that can be used for VM creation


curl -X GET "https://api.gitc.dk/api/service/@id/networks" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/networks');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/networks', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/networks

List VM Network Interfaces

Get network interfaces assigned to virtual server


curl -X GET "https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms/@vmid/interfaces');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces

Get Network Interfaces

Get network Interface details


curl -X GET "https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/vms/@vmid/interfaces/@iface');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
iface string

Interface name or id, ie '0' or 'net0'

Update Network Interface

Update network interface details

POST_DATA="{
    \"iface\": \"ifaceValue\",
    \"firewall\": \"firewallValue\",
    \"ipv4\": \"ipv4Value\",
    \"ipv6\": \"ipv6Value\"
}"

curl -X PUT "https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "iface" => "ifaceValue",
        "firewall" => "firewallValue",
        "ipv4" => "ipv4Value",
        "ipv6" => "ipv6Value"
    ]
]
$resp = $client->put('service/@id/vms/@vmid/interfaces/@iface', $options);
echo $resp->getBody();
payload = {
    'iface': "ifaceValue",
    'firewall': "firewallValue",
    'ipv4': "ipv4Value",
    'ipv6': "ipv6Value"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface', json=payload, headers=headers)
print(req.json())

HTTP Request

PUT /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
iface int

Interface number

firewall int

Enable or disable firewall (may require specific permissions)

ipv4 int[]

List of IP v4 IDs

ipv6 int[]

List of IP v6 IDs

Add Network Interface

Add new network interface to VM

POST_DATA="{
    \"bridge\": \"bridgeValue\",
    \"firewall\": \"firewallValue\",
    \"ipv4\": \"ipv4Value\",
    \"ipv6\": \"ipv6Value\"
}"

curl -X POST "https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "bridge" => "bridgeValue",
        "firewall" => "firewallValue",
        "ipv4" => "ipv4Value",
        "ipv6" => "ipv6Value"
    ]
]
$resp = $client->post('service/@id/vms/@vmid/interfaces', $options);
echo $resp->getBody();
payload = {
    'bridge': "bridgeValue",
    'firewall': "firewallValue",
    'ipv4': "ipv4Value",
    'ipv6': "ipv6Value"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces', json=payload, headers=headers)
print(req.json())

HTTP Request

POST /service/@id/vms/@vmid/interfaces

Query Parameters

Parameter Type Description
bridge string

Network bridge

firewall int

Enable or disable firewall (may require specific permissions)

ipv4 int[]

List of IP v4 IDs

ipv6 int[]

List of IP v6 IDs

Remove Network Interface

Remove network interface from VM


curl -X DELETE "https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->delete('service/@id/vms/@vmid/interfaces/@iface');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.delete('https://api.gitc.dk/api/service/@id/vms/@vmid/interfaces/@iface', headers=headers)
print(req.json())

HTTP Request

DELETE /service/@id/vms/@vmid/interfaces/@iface

Query Parameters

Parameter Type Description
iface string|int

Interface name or id to remove

List OS templates

List templates that can be used to create virtual server


curl -X GET "https://api.gitc.dk/api/service/@id/templates" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/templates');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/templates', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/templates

Resources

Show available and used resources


curl -X GET "https://api.gitc.dk/api/service/@id/resources" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@id/resources');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@id/resources', headers=headers)
print(req.json())

HTTP Request

GET /service/@id/resources

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 -X GET "https://api.gitc.dk/api/category" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('category');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/category', headers=headers)
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 -X GET "https://api.gitc.dk/api/category/@category_id/product" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('category/@category_id/product');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/category/@category_id/product', headers=headers)
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 -X GET "https://api.gitc.dk/api/order/@product_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('order/@product_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/order/@product_id', headers=headers)
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

POST_DATA="{
    \"product_id\": 12,
    \"domain\": \"example.com\",
    \"cycle\": \"m\",
    \"pay_method\": \"1\",
    \"custom\": {
        \"1618\": {
            \"10330\": 1
        }
    },
    \"promocode\": \"T346F\",
    \"aff_id\": 55
}"

curl -X POST "https://api.gitc.dk/api/order/@product_id" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "product_id" => 12,
        "domain" => "example.com",
        "cycle" => "m",
        "pay_method" => "1",
        "custom" => [
            1618 => [
                10330 => 1
            ]
        ],
        "promocode" => "T346F",
        "aff_id" => 55
    ]
]);

$resp = $client->post('order/@product_id', $options);
echo $resp->getBody();
payload = {
    'product_id': 12,
    'domain': "example.com",
    'cycle': "m",
    'pay_method': "1",
    'custom': {
        '1618': {
            '10330': 1
        }
    },
    'promocode': "T346F",
    'aff_id': 55
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/order/@product_id', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "order_num": 873340995,
    "invoice_id": "308979",
    "total": "9.99",
    "items": {
        "id": "10",
        "type": "Hosting",
        "name": "test.com",
        "product_id": "3"
    }
}

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

promocode string

Promotion code

aff_id int

Affiliate ID

Order multiple services

Create and submit new order for multiple services

Each item in the items array needs to include order type and parameters used by one of the method listed below:
POST /order/$product_id - use product for item type

POST_DATA="{
    \"pay_method\": 1,
    \"ignore_errors\": \"No error\",
    \"items\": [
        {
            \"type\": \"product\",
            \"product_id\": 1080,
            \"domain\": \"hosting.com\",
            \"cycle\": \"a\"
        }
    ],
    \"aff_id\": 55
}"

curl -X POST "https://api.gitc.dk/api/order" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "pay_method" => 1,
        "ignore_errors" => "No error",
        "items" => [
            [
                "type" => "product",
                "product_id" => 1080,
                "domain" => "hosting.com",
                "cycle" => "a"
            ]
        ],
        "aff_id" => 55
    ]
]
$resp = $client->post('order', $options);
echo $resp->getBody();
payload = {
    'pay_method': 1,
    'ignore_errors': "No error",
    'items': [
        {
            'type': "product",
            'product_id': 1080,
            'domain': "hosting.com",
            'cycle': "a"
        }
    ],
    'aff_id': 55
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/order', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "order_num_list": [
        179534732,
        179534732,
        179534732
    ],
    "invoice_id": "503425",
    "total": "94.40",
    "items": [
        {
            "type": "Hosting",
            "id": "1025",
            "name": "hosting.com",
            "product_id": "1080"
        },
        {
            "type": "Hosting",
            "id": "1026",
            "name": "hosting.com",
            "product_id": "840"
        },
        {
            "type": "Domain Register",
            "id": "354",
            "name": "hosting.com",
            "product_id": "6"
        }
    ]
}

HTTP Request

POST /order

Query Parameters

Parameter Type Description
pay_method int

Payment method ID

ignore_errors bool

Process order even if some of the items were rejected due to errors

items array

list with order items

aff_id int

Affiliate ID

Get order quote

Calculate order cost and recurring prices for selected items. Use the same parameters as for POST /order

POST_DATA="{
    \"pay_method\": \"pay_methodValue\",
    \"output\": \"short\",
    \"items\": [
        {
            \"type\": \"product\",
            \"product_id\": 1080,
            \"domain\": \"hosting.com\",
            \"cycle\": \"a\"
        }
    ]
}"

curl -X POST "https://api.gitc.dk/api/quote" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "pay_method" => "pay_methodValue",
        "output" => "short",
        "items" => [
            [
                "type" => "product",
                "product_id" => 1080,
                "domain" => "hosting.com",
                "cycle" => "a"
            ]
        ]
    ]
]
$resp = $client->post('quote', $options);
echo $resp->getBody();
payload = {
    'pay_method': "pay_methodValue",
    'output': "short",
    'items': [
        {
            'type': "product",
            'product_id': 1080,
            'domain': "hosting.com",
            'cycle': "a"
        }
    ]
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/quote', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "summary": {
        "subtotal": 72.2,
        "total": 88.81,
        "credit": 0,
        "discount": 0,
        "cost": 72.2,
        "recurring": [
            {
                "title": "Annually",
                "price": 81.18,
                "value": "a"
            },
            {
                "title": "Monthly",
                "price": 1.48,
                "value": "m"
            }
        ],
        "tax": [
            {
                "name": "VAT",
                "tax": 16.61,
                "value": 23
            }
        ]
    },
    "items": [
        {
            "product": {
                "id": 1080,
                "category_name": "SSL",
                "category_id": 69,
                "name": "GeoTrust QuickSSL Premium",
                "domain": "test.api",
                (...)
            },
            "domains": {
                (...)
            },
            "coupon": {},
            "index": 0,
            "valid": true,
            "info": [],
            "error": []
        },
        {
            "product": {
                "id": 840,
                "category_name": "Proxmox",
                "category_id": 19,
                "name": "VPS",
                "domain": "user.test.api",
                (...)
            },
            "domains": {
                (...)
            },
            "coupon": {},
            "index": 1,
            "valid": true,
            "info": [],
            "error": []
        },
        {
            "product": null,
            "domains": {
                "hosting.com": {
                    "id": 6,
                    "index": 0,
                    "category_id": "6",
                    "category_name": "Domains",
                    "name": "hosting.com",
                    "tld": ".com",
                    "period": 1,
                    "price": "12.00",
                    (...) 
                }
            },
            "coupon": {},
            "index": 2,
            "valid": true,
            "info": [],
            "error": []
        }
    ]
}

HTTP Request

POST /quote

Query Parameters

Parameter Type Description
pay_method int

Payment method ID

output string

Type of output, default is short. Possible options

  • short - Basic details about the item in cart
  • config- Basic details and form components
  • full - All details available in cart
items array

list with order items

DNS

List DNS

Returns a list of all DNS


curl -X GET "https://api.gitc.dk/api/dns" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('dns');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/dns', headers=headers)
print(req.json())
Example Response:
{
    "service_ids": [
        "10",
        "20"
    ],
    "zones": [
        {
            "domain_id": "60",
            "name": "qwerty.com",
            "service_id": "10"
        },
        {
            "domain_id": "61",
            "name": "bgg12ooble.com",
            "service_id": "20"
        }
    ]
}

HTTP Request

GET /dns

Add DNS Zone

Creates a new DNS zone

POST_DATA="{
    \"service_id\": \"service_idValue\",
    \"name\": \"testzone.com\"
}"

curl -X POST "https://api.gitc.dk/api/service/@service_id/dns" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "service_id" => "service_idValue",
        "name" => "testzone.com"
    ]
]
$resp = $client->post('service/@service_id/dns', $options);
echo $resp->getBody();
payload = {
    'service_id': "service_idValue",
    'name': "testzone.com"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@service_id/dns', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "info": [
        "Domain zone testzone.com was created successfully."
    ]
}

HTTP Request

POST /service/@service_id/dns

Query Parameters

Parameter Type Description
service_id int

Service ID

name string

Zone name

List DNS for service

Returns a list of DNS zones under the service


curl -X GET "https://api.gitc.dk/api/service/@service_id/dns" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@service_id/dns');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@service_id/dns', headers=headers)
print(req.json())
Example Response:
{
    "error": [
        "invalid method"
    ]
}

HTTP Request

GET /service/@service_id/dns

Query Parameters

Parameter Type Description
service_id int

Service ID

Get DNS details

Returns details of the DNS zone


curl -X GET "https://api.gitc.dk/api/service/@service_id/dns/@zone_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('service/@service_id/dns/@zone_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/service/@service_id/dns/@zone_id', headers=headers)
print(req.json())
Example Response:
{
    "service_id": 10,
    "name": "qwerty.com",
    "records": [
      {
        "id":"10",
        "name":"qwerty",
        "ttl":1800,
        "priority":0,
        "content":"127.0.0.1",
        "type":"A"
      },
      {
        "id":"11",
        "name":"qwerty",
        "ttl":1800,
        "priority":0,
        "content":"ns1.qwerty.com",
        "type":"NS"
      }
    ]
}

HTTP Request

GET /service/@service_id/dns/@zone_id

Query Parameters

Parameter Type Description
service_id int

Service ID

zone_id int

Zone ID

Add DNS Record

Creates a new record in the DNS zone

POST_DATA="{
    \"service_id\": \"service_idValue\",
    \"zone_id\": \"zone_idValue\",
    \"name\": \"example.com\",
    \"ttl\": 3600,
    \"priority\": 10,
    \"type\": \"A\",
    \"content\": \"192.168.1.2\"
}"

# OR ...

POST_DATA="{
    \"service_id\": \"service_idValue\",
    \"zone_id\": \"zone_idValue\",
    \"name\": \"_sip._tcp.example.com\",
    \"ttl\": 3600,
    \"priority\": 10,
    \"type\": \"SRV\",
    \"content\": [
        10,
        5060,
        \"vc01.example.com\"
    ]
}"

curl -X POST "https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "service_id" => "service_idValue",
        "zone_id" => "zone_idValue",
        "name" => "example.com",
        "ttl" => 3600,
        "priority" => 10,
        "type" => "A",
        "content" => "192.168.1.2"
    ]
]);

// OR ...

$options = [
    'json' => [
        "service_id" => "service_idValue",
        "zone_id" => "zone_idValue",
        "name" => "_sip._tcp.example.com",
        "ttl" => 3600,
        "priority" => 10,
        "type" => "SRV",
        "content" => [
            10,
            5060,
            "vc01.example.com"
        ]
    ]
]);

$resp = $client->post('service/@service_id/dns/@zone_id/records', $options);
echo $resp->getBody();
payload = {
    'service_id': "service_idValue",
    'zone_id': "zone_idValue",
    'name': "example.com",
    'ttl': 3600,
    'priority': 10,
    'type': "A",
    'content': "192.168.1.2"
}

# OR ...

payload = {
    'service_id': "service_idValue",
    'zone_id': "zone_idValue",
    'name': "_sip._tcp.example.com",
    'ttl': 3600,
    'priority': 10,
    'type': "SRV",
    'content': [
        10,
        5060,
        "vc01.example.com"
    ]
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.post('https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "record": {
      "name": "_sip._tcp.example.com",
      "type": "SRV",
      "ttl": "3600",
      "priority": "10",
      "content": [
        10,
        5060,
        "vc01.example.com"
      ]
    },
    "info": [
        "dnsnewrecordadded",
        "SRV"
    ]
}

HTTP Request

POST /service/@service_id/dns/@zone_id/records

Query Parameters

Parameter Type Description
service_id int

Service ID

zone_id int

Zone ID

name string

Record name

ttl int

Record ttl

priority int

Priority of the record

type string

Record type

content string

Contents of the record

Edit DNS Record

Edits the selected DNS zone record

POST_DATA="{
    \"service_id\": \"service_idValue\",
    \"zone_id\": \"zone_idValue\",
    \"record_id\": \"record_idValue\",
    \"name\": \"example.com\",
    \"ttl\": 3600,
    \"priority\": 10,
    \"type\": \"A\",
    \"content\": \"192.168.1.2\"
}"

curl -X PUT "https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records/@record_id" \
   -H "Authorization: Bearer $token" \
   -H "Content-Type: application/json" \
   -d "${POST_DATA}"
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);

$options = [
    'json' => [
        "service_id" => "service_idValue",
        "zone_id" => "zone_idValue",
        "record_id" => "record_idValue",
        "name" => "example.com",
        "ttl" => 3600,
        "priority" => 10,
        "type" => "A",
        "content" => "192.168.1.2"
    ]
]
$resp = $client->put('service/@service_id/dns/@zone_id/records/@record_id', $options);
echo $resp->getBody();
payload = {
    'service_id': "service_idValue",
    'zone_id': "zone_idValue",
    'record_id': "record_idValue",
    'name': "example.com",
    'ttl': 3600,
    'priority': 10,
    'type': "A",
    'content': "192.168.1.2"
}

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.put('https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records/@record_id', json=payload, headers=headers)
print(req.json())
Example Response:
{
    "record": {
        "id": "55",
        "type": "A",
        "ttl": "3600",
        "name": "test",
        "priority": 0,
        "content": "192.168.1.2"
    },
    "info": [
        "The record was updated successfully."
    ]
}

HTTP Request

PUT /service/@service_id/dns/@zone_id/records/@record_id

Query Parameters

Parameter Type Description
service_id int

Service ID

zone_id int

Zone ID

record_id int

Record ID

name string

Record name

ttl int

Record ttl

priority int

Priority of the record

type string

Record type

content string

Contents of the record

Remove DNS Record

Removes the selected DNS zone record


curl -X DELETE "https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records/@record_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->delete('service/@service_id/dns/@zone_id/records/@record_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.delete('https://api.gitc.dk/api/service/@service_id/dns/@zone_id/records/@record_id', headers=headers)
print(req.json())

HTTP Request

DELETE /service/@service_id/dns/@zone_id/records/@record_id

Query Parameters

Parameter Type Description
service_id int

Service ID

zone_id int

Zone ID

record_id int

Record ID

Support

List News

List News


curl -X GET "https://api.gitc.dk/api/news" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('news');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/news', headers=headers)
print(req.json())

HTTP Request

GET /news

Get news item

Returns details of the news item


curl -X GET "https://api.gitc.dk/api/news/@news_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('news/@news_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/news/@news_id', headers=headers)
print(req.json())

HTTP Request

GET /news/@news_id

List all knowledgebase categories

Returns list all knowledgebase categories


curl -X GET "https://api.gitc.dk/api/knowledgebase" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('knowledgebase');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/knowledgebase', headers=headers)
print(req.json())

HTTP Request

GET /knowledgebase

Get knowledgebase category details

Returns subcategories and articles of the knowledgebase category


curl -X GET "https://api.gitc.dk/api/knowledgebase/@category_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('knowledgebase/@category_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/knowledgebase/@category_id', headers=headers)
print(req.json())

HTTP Request

GET /knowledgebase/@category_id

Get knowledgebase article

Returns an article details


curl -X GET "https://api.gitc.dk/api/knowledgebase/article/@article_id" \
   -H "Authorization: Bearer $token" 
use GuzzleHttp\Client;

$client = new Client([
    'base_uri' => 'https://api.gitc.dk/api/',
    'headers' => [
        'Authorization' => 'Bearer ' . $token
    ]
]);


$resp = $client->get('knowledgebase/article/@article_id');
echo $resp->getBody();

headers = {
    'Authorization': 'Bearer ' + token
}

req = requests.get('https://api.gitc.dk/api/knowledgebase/article/@article_id', headers=headers)
print(req.json())

HTTP Request

GET /knowledgebase/article/@article_id