Hosting Management

Index

Hosting management resources

Webhosting

Databases

Mailboxes

List of all hostings

Available parameters:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting HTTP/1.1

Accept: application/json

Response 200

{
  "items": [
    {
      "id": 300000,
      "name": "hostingname_1",
      "uuid": "223114ae-7abb-4b9f-8788-0c4795d7257b"
    },
    {
      "id": 400000,
      "name": "hostingname_2",
      "uuid": "d3860eb5-caeb-42d7-a2f4-591f45996fe2"
    }
  ],
  "pager": {
    "page": 1,
    "pagesize": null,
    "items": 2
  }
}

Get a hosting detail

Get hosting by service_id or uuid.

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id-or-uuid" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id-or-uuid HTTP/1.1

Accept: application/json

Response 200

{
  "id": 300000,
  "name": "hostingname_1",
  "uuid": "223114ae-7abb-4b9f-8788-0c4795d7257b"
}

List of all webhosting domains (vhosts)

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost HTTP/1.1

Accept: application/json

Response 200

{
  "items": [
    {
      "id": 114504,
      "domain": "blablabla.com",
      "sub": "ahoj",
      "webOnStorage": "blablabla.com",
      "subOnStorage": "blablabla.com/sub",
      "logsOnStorage": "logs",
      "disabled": false,
      "keepAliveOff": false,
      "phpOpenBaseDir": false,
      "phpOpenBaseDirStorage": false,
      "phpOpenBaseDirAll": false,
      "phpOpenBaseWebInWeb": false,
      "nonExistSubDomainsToWeb": false,
      "phpMysql51Default": true,
      "phpMysql50Default": false,
      "phpMysql55Default": false,
      "phpSafeModeOff": false,
      "phpRegisterGlobalsOff": false,
      "phpUploadMaxFilesize": 48,
      "phpMemoryLimit": 48,
      "phpPostMaxSize": 48,
      "phpMaxExecutionTime": 30
    },
    {
      "id": 114516,
      "domain": "hosting20testtest.sk",
      "sub": "blog",
      "webOnStorage": "hosting20testtest.sk/web",
      "subOnStorage": "hosting20testtest.sk/sub",
      "logsOnStorage": "logs",
      "disabled": false,
      "keepAliveOff": false,
      "phpOpenBaseDir": false,
      "phpOpenBaseDirStorage": false,
      "phpOpenBaseDirAll": false,
      "phpOpenBaseWebInWeb": false,
      "nonExistSubDomainsToWeb": true,
      "phpMysql51Default": true,
      "phpMysql50Default": false,
      "phpMysql55Default": false,
      "phpSafeModeOff": false,
      "phpRegisterGlobalsOff": false,
      "phpUploadMaxFilesize": 48,
      "phpMemoryLimit": 48,
      "phpPostMaxSize": 48,
      "phpMaxExecutionTime": 30
    }
  ],
  "pager": {
    "page": 1,
    "pagesize": null,
    "items": 2
  }
}

Get a webhosting domain (vhost) detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost/:id" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost/:id HTTP/1.1

Accept: application/json

Response 200

{
  "id": 114504,
  "domain": "blablabla.com",
  "sub": "ahoj",
  "webOnStorage": "blablabla.com",
  "subOnStorage": "blablabla.com/sub",
  "logsOnStorage": "logs",
  "disabled": false,
  "keepAliveOff": false,
  "phpOpenBaseDir": false,
  "phpOpenBaseDirStorage": false,
  "phpOpenBaseDirAll": false,
  "phpOpenBaseWebInWeb": false,
  "nonExistSubDomainsToWeb": false,
  "phpMysql51Default": true,
  "phpMysql50Default": false,
  "phpMysql55Default": false,
  "phpSafeModeOff": false,
  "phpRegisterGlobalsOff": false,
  "phpUploadMaxFilesize": 48,
  "phpMemoryLimit": 48,
  "phpPostMaxSize": 48,
  "phpMaxExecutionTime": 30
}

List of all databases

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "id": 239365, 
            "dbName": "pm56j8m60i808w", 
            "dbUser": "pm56j8m60i808w", 
            "dbType": "mariadb55", 
            "deleted": false, 
            "disabled": false, 
            "domain": "testingdomain.sk", 
            "note": "wordpress"
        }
    ], 
    "pager": {
        "items": 1, 
        "page": 1, 
        "pagesize": null
    },
    "domains": [
        "testingdomain.sk"
    ]
}

Get database detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id HTTP/1.1

Accept: application/json

Response 200

{
    "id": 239365, 
    "dbName": "pm56j8m60i808w", 
    "dbUser": "pm56j8m60i808w", 
    "dbType": "mariadb55", 
    "deleted": false, 
    "disabled": false, 
    "domain": "testingdomain.sk", 
    "note": "wordpress"
}

Response 404

{
    "code": 404,
    "message": "Database not found"
}

Create new database

Parameters:

Name Type Required Comment
domain string yes domain in selected hosting (sometimes not required)
dbName string yes database name
dbUser string yes database user
dbPassword string yes password
dbType string yes choose one from: mariadb101, mysql57, mariadb55, mysql51, mysql50, postgresql90
note string no your note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret -H "Content-Type: application/json" -X POST \ 
-d '{"domain": "aaa.sk", "dbName": "testdb", "dbType": "mariadb55", "dbUser": "testdb", "note": "test"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "domain": "aaa.sk",
    "dbName": "testdb",
    "dbPassword": "testdb",
    "dbType": "mariadb55",
    "dbUser": "testdb",
    "note": "test"
}

Response 200

{
    "item": {
        "id": null, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": null, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {
        "dbName": [
            "Db Name cannot be blank."
        ]
    }, 
    "status": "error"
}

Update database

Parameters:

Name Type Required Comment
dbPassword string no password
note string no note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:secret -H "Content-Type: application/json" -X PUT \ 
-d '{"dbPassword": "asdf", "note": "test"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/db HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "dbPassword": "testdb",
    "note": "test"
}

Response 200

{
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    },
    "errors": {
        "dbPassword": [
            "Db Password is too short (minimum is 8 characters)."
        ]
    }, 
    "status": "error"
}

Delete a database

No parameters required.

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -X DELETE -u key:secret

Request

DELETE https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id HTTP/1.1

Accept: application/json

Response 200

{
    "errors": {}, 
    "item": {
        "id": 1234, 
        "dbName": "testdb", 
        "dbUser": "testdb", 
        "dbType": "mariadb55", 
        "deleted": false, 
        "disabled": false, 
        "domain": "aaa.sk", 
        "note": "test"
    }, 
    "status": "success"
}

DB size

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "size": 12044, 
            "timestamp": 1428357600
        }, 
        {
            "size": 12544, 
            "timestamp": 1428444000
        },
    ...
    ],
    "range": [
        1428332843, 
        1431011242
    ]
}

DB cpu

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "access_denied": 0, 
            "binlog_bytes_written": 0, 
            "busy_time": 0, 
            "bytes_received": 0, 
            "bytes_sent": 0, 
            "commit_transactions": 0, 
            "concurrent_connections": 0, 
            "connected_time": 0, 
            "cpu_time": 10, 
            "denied_connections": 0, 
            "empty_queries": 0, 
            "lost_connections": 0, 
            "other_commands": 0, 
            "rollback_transactions": 0, 
            "rows_fetched": 0, 
            "rows_updated": 0, 
            "select_commands": 0, 
            "table_rows_read": 0, 
            "timestamp": 1428357600, 
            "total_connections": 0, 
            "update_commands": 0
        }, 
    ...
    ],
    "range": [
        1428332843, 
        1431011242
    ]
}

List of all mailboxes

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "id": 1234,
            "domain": "testingdomain.sk",
            "domainId": 12345,
            "email": "foo@testingdomain.sk",
            "mailBox": "foo",
            "deleted" : false,
            "disabled": false,
            "imapDisabled": false,
            "pop3Disabled": false,
            "ipCheck": false,
            "countryCheck": true,
            "countries": [
                "SK",
                "CZ",
                "HU",
                "AT"
            ],
            "note": ""
        },
        {
        "id": 1235,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "bar@testingdomain.sk",
        "mailBox": "bar",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "note": "",
        "ipCheck": false,
        "countryCheck": false
        },
        ...
    ], 
    "pager": {
        "items": 1, 
        "page": 1, 
        "pagesize": null
    },
    "domains": [
        "testingdomain.sk"
    ]
}

Get mailbox detail

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox/:id" -v -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox/:id HTTP/1.1

Accept: application/json

Response 200

{
    "id": 1234,
    "domain": "testingdomain.sk",
    "domainId": 12345,
    "email": "foo@testingdomain.sk",
    "mailBox": "foo",
    "deleted" : false,
    "disabled": false,
    "imapDisabled": false,
    "pop3Disabled": false,
    "ipCheck": false,
    "countryCheck": true,
    "countries": [
        "SK",
        "CZ",
        "HU",
        "AT"
    ],
    "note": ""
}

Create new mailbox

Parameters:

Name Type Required Default Comment
email string yes mailbox name e.g. foo for foo@testdomain.sk
password string yes mailbox password
ipCheck boolean no false Enable access to selected IP addresses
ips Array no Array of IPs for ipCheck in format 1.2.3.0/24 or 1.2.3.4
countryCheck boolean no true Enable access to selected countries
countries Array no ["SK", "CZ", "HU", "AT"] Array of countries for countryCheck, 2-letter country identifier as SK,CZ etc.
imapDisabled boolean no false disable IMAP
pop3Disabled boolean no false disable POP3
note string no your note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox" -v -u key:secret -H "Content-Type: application/json" -X POST \ 
-d '{"email": "foonew", "password": "testpassword", "ipCheck": true, "ips": ["1.2.3.4", "8.8.8.8"], "countryCheck": true, "countries": ["SK", "CZ", "HU"] "note": "test"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "email": "foonew",
    "password": "testpassword",
    "ipCheck": true,
    "ips": ["1.2.3.4", "8.8.8.8"],
    "countryCheck": true,
    "countries": [
        "SK",
        "CZ",
        "HU"
    ],
    "note": "test"
}

Response 200

{
    "item": {
        "id": 1234,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "foonew@testingdomain.sk",
        "mailBox": "foonew",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "ipCheck": true,
        "ips": ["1.2.3.4/32", "8.8.8.8/32"],
        "countryCheck": true,
        "countries": [
            "SK",
            "CZ",
            "HU"
        ],
        "note": "test"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": null,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "@testingdomain.sk",
        "mailBox": "",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "ipCheck": true,
        "ips": ["1.2.3.4/32", "8.8.8.8/32"],
        "countryCheck": true,
        "countries": [
            "SK",
            "CZ",
            "HU"
        ],
        "note": "test"
    },
    "errors": {
        "email": [
           "Email cannot be blank.",
           "Email is not a valid email address."
       ],
       "password": [
           "Password cannot be blank."
       ]
    }, 
    "status": "error"
}

Update mailbox

Parameters:

Name Type Required Comment
password string no mailbox password
ipCheck boolean no Enable access to selected IP addresses
ips Array no Array of IPs for ipCheck in format 1.2.3.0/24 or 1.2.3.4
countryCheck boolean no Enable access to selected countries
countries Array no Array of countries for countryCheck, 2-letter country identifier as SK,CZ etc.
imapDisabled boolean no disable IMAP
pop3Disabled boolean no disable POP3
note string no your note

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox/:id" -v -u key:secret -H "Content-Type: application/json" -X POST \ 
-d '{"password": "changedpassword", "ipCheck": false, "countryCheck": true, "countries": ["SK"] "note": "test update"}'

Request

POST https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox/:id HTTP/1.1

Accept: application/json
Content-Type: application/json

{
    "password": "changedpassword",
    "ipCheck": false,
    "countryCheck": true,
    "countries": [
        "SK"
    ],
    "note": "test update"
}

Response 200

{
    "item": {
        "id": 1234,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "foo@testingdomain.sk",
        "mailBox": "foo",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "ipCheck": false,
        "countryCheck": true,
        "countries": [
            "SK"
        ],
        "note": "test update"
    },
    "errors": {}, 
    "status": "success"
}

Validation error 200

{
    "item": {
        "id": 1234,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "foo@testingdomain.sk",
        "mailBox": "foo",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "ipCheck": false,
        "countryCheck": true,
        "countries": [
            "SK"
        ],
        "note": "test update"
    },
    "errors": {
        "password": [
           "Password cannot be blank."
        ]
    }, 
    "status": "error"
}

Delete mailbox

No parameters required.

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox/:id" -X DELETE -u key:secret

Request

DELETE https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox/:id HTTP/1.1

Accept: application/json

Response 200

{
    "errors": {}, 
    "item": {
        "id": 1234,
        "domain": "testingdomain.sk",
        "domainId": 12345,
        "email": "foo@testingdomain.sk",
        "mailBox": "foo",
        "deleted" : false,
        "disabled": false,
        "imapDisabled": false,
        "pop3Disabled": false,
        "ipCheck": false,
        "countryCheck": true,
        "countries": [
            "SK"
        ],
        "note": "test update"
    }, 
    "status": "success"
}

Email size history per hosting

Get email size history per hosting (multiple domains).

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "domains": [
        "testdomain1.sk",
        "testdomain2.sk"
    ], 
    "items": [
        {
            "size": 2903830, 
            "timestamp": 1434924000
        }, 
        {
            "size": 2904153, 
            "timestamp": 1435010400
        }, 
    ...
    ],
    "range": [
        1434880348, 
        1437558747
    ]
}

Email size history per domain

Get email size history per domain.

Paramaters for changing time interval and period:

Curl

curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats" -u key:secret

Request

GET https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats HTTP/1.1

Accept: application/json

Response 200

{
    "items": [
        {
            "size": 2903830, 
            "timestamp": 1434924000
        }, 
        {
            "size": 2904153, 
            "timestamp": 1435010400
        }, 
    ...
    ],
    "range": [
        1434880348, 
        1437558747
    ]
}
raw