Webhosting domains
Stats
Mailboxes management
Stats
Available parameters:
page
(int, not required)pagesize
(int, not required)Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting" -v -u key:signature -H "Date: request_date_time"
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 hosting by service_id or uuid.
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id-or-uuid" -v -u key:signature -H "Date: request_date_time"
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" }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost" -v -u key:signature -H "Date: request_date_time"
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 } }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/vhost/:id" -v -u key:signature -H "Date: request_date_time"
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 }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/size-stats" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:id/hosting/:id/size-stats HTTP/1.1 Accept: application/json
Response
200
{ "hosting": "testing_sk", "used": 3.2723, "free": 46.72765, "available": 50 }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/domain-stats" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:id/hosting/:id/domain-stats HTTP/1.1 Accept: application/json
Response
200
{ "hosting": "testing_sk", "used": 28, "free": 2, "available": 30 }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/ftp-stats" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:id/hosting/:id/ftp-stats HTTP/1.1 Accept: application/json
Response
200
{ "hosting": "testing_sk", "used": 3.308377265930176, "free": 45.77929973602295, "available": 50 }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:signature -H "Date: request_date_time"
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": "mariadb105", "deleted": false, "disabled": false, "domain": "testingdomain.sk", "note": "wordpress" } ], "pager": { "items": 1, "page": 1, "pagesize": null }, "domains": [ "testingdomain.sk" ] }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/dbusers" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:id/hosting/:id/dbusers HTTP/1.1 Accept: application/json
Response
200
{ "items":[ { "id":239369, "dbUser":"TestingUser1", "domain":"testingdomain.sk", "dbType":"mariadb105" }, { "id":237365, "dbUser":"TestingUser", "domain":"testingdomain2.sk", "dbType":"mariadb103" } ], "domains":[ "testingdomain.sk", "testingdomain2.sk" ], "pager":{ "page":1, "pagesize":null, "items":2 } }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -v -u key:signature -H "Date: request_date_time"
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": "mariadb105", "deleted": false, "disabled": false, "domain": "testingdomain.sk", "note": "wordpress" }
Response
404
{ "code": 404, "message": "Database not found" }
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 | no | password required when creating new user, when assigning existing do not send |
dbType | string | yes | choose one from: mariadb105 , mariadb103 , mysql80 , mysql57 , postgresql100 |
defaultCollation | string | yes | default character encoding |
note | string | no | your note |
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db" -v -u key:signature -H "Content-Type: application/json" -H "Date: request_date_time" -X POST \ -d '{"domain": "aaa.sk", "dbName": "testdb", "dbType": "mariadb105", "dbUser": "testdb", "defaultCollation": "utf8_general_ci", "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": "mariadb105", "dbUser": "testdb", "defaultCollation": "utf8_general_ci", "note": "test" }
Response
200
{ "item": { "id": null, "dbName": "testdb", "dbUser": "testdb", "dbType": "mariadb105", "deleted": false, "disabled": false, "domain": "aaa.sk", "note": "test" }, "errors": {}, "status": "success" }
Validation error
200
{ "item": { "id": null, "dbName": "testdb", "dbUser": "testdb", "dbType": "mariadb105", "deleted": false, "disabled": false, "domain": "aaa.sk", "note": "test" }, "errors": { "dbName": [ "Db Name cannot be blank." ] }, "status": "error" }
Name | Type | Required | Comment |
---|---|---|---|
dbPassword | string | no | password |
note | string | no | note |
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -v -u key:signature -H "Content-Type: application/json" -H "Date: request_date_time" -X PUT \ -d '{"dbPassword": "asdf", "note": "test"}'
Request
PUT https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id HTTP/1.1 Accept: application/json Content-Type: application/json { "dbPassword": "testdb", "note": "test" }
Response
200
{ "item": { "id": 1234, "dbName": "testdb", "dbUser": "testdb", "dbType": "mariadb105", "deleted": false, "disabled": false, "domain": "aaa.sk", "note": "test" }, "errors": {}, "status": "success" }
Validation error
200
{ "item": { "id": 1234, "dbName": "testdb", "dbUser": "testdb", "dbType": "mariadb105", "deleted": false, "disabled": false, "domain": "aaa.sk", "note": "test" }, "errors": { "dbPassword": [ "Db Password is too short (minimum is 8 characters)." ] }, "status": "error" }
No parameters required.
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id" -X DELETE -u key:signature -H "Date: request_date_time"
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": "mariadb105", "deleted": false, "disabled": false, "domain": "aaa.sk", "note": "test" }, "status": "success" }
Parameters for changing time interval and period:
day
or hour
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats" -u key:signature -H "Date: request_date_time"
Curl (with parameters)
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats" -G -d interval=hour -d length=12 -u key:signature -H "Date: request_date_time" >Request
[json] GET https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/size-stats HTTP/1.1
Accept: application/json
>Response `200`
[json] { "items": [ { "size": 12044, "timestamp": 1428357600 }, { "size": 12544, "timestamp": 1428444000 }, ... ], "range": [ 1428332843, 1431011242 ] }
DB cpu {#db-cpu} ------------------ Parameters for changing time interval and period: - **interval** (string) `day`, `hour` or `minute` - **length** (integer) number of shown measurements (time period depends on chosen interval) >Curl
[sh] curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats" -u key:signature -H "Date: request_date_time"
>Curl (with parameters)
[sh] curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/db/:id/cpu-stats" -G -d interval=hour -d length=12 -u key:signature -H "Date: request_date_time"
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 ] }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox" -v -u key:signature -H "Date: request_date_time"
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" ] }
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mailbox/:id" -v -u key:signature -H "Date: request_date_time"
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": "" }
Name | Type | Required | Default | Comment |
---|---|---|---|---|
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:signature -H "Content-Type: application/json" -H "Date: request_date_time" -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" }
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:signature -H "Content-Type: application/json" -H "Date: request_date_time" -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" }
No parameters required.
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/domain/:id/mailbox/:id" -X DELETE -u key:signature -H "Date: request_date_time"
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" }
Get email size history per hosting (multiple domains).
Parameters for changing time interval and period:
day
or hour
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats" -u key:signature -H "Date: request_date_time"
Curl (with parameters)
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/size-stats" -G -d interval=hour -d length=12 -u key:signature -H "Date: request_date_time"
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 ] }
Get email size history per domain.
Parameters for changing time interval and period:
day
or hour
Curl
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats" -u key:signature -H "Date: request_date_time"
Curl (with parameters)
curl "https://rest.websupport.sk/v1/user/:id/hosting/:id/mail/:domain/size-stats" -G -d interval=hour -d length=12 -u key:signature -H "Date: request_date_time"
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 ] }
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account HTTP/1.1 Accept: application/json
Response
200
{ "items": [ { "id": 614561, "createTime": 1620907956, "hostingId": 1305518, "login": "foo.testingdomain.sk", "disabled": false, "note": "API test" }, { "id": 614594, "createTime": 1620908851, "hostingId": 1305518, "login": "bar.testingdomain.sk", "disabled": false, "note": "API test 2" } ], "pager": { "page": 1, "pagesize": null, "items": 2 } }
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account/:ftpAccountId" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account/:ftpAccountId HTTP/1.1 Accept: application/json
Response
200
{ "id": 614561, "createTime": 1620907956, "hostingId": 1305518, "login": "foo.testingdomain.sk", "dir": "/", "disabled": false, "ftpEnabled": false, "sshEnabled": true, "countryCheck": true, "ipCheck": true, "countries": [ "CZ", "HU", "SK" ], "ips": [], "note": "API test" }
Name | Type | Required | Default | Comment |
---|---|---|---|---|
login | string | yes | FTP login foo for foo.testingdomain.sk |
|
password | string | yes | FTP password | |
dir | string | no | / |
Enable access to directory |
disabled | boolean | no | Deactivate account | |
ftpEnabled | boolean | no | true |
Enable FTP |
sshEnabled | boolean | no | Enable SFTP | |
countryCheck | boolean | no | false |
Enable access to selected countries |
ipCheck | boolean | no | false |
Enable access to selected IP addresses |
countries | Array | no | ["SK", "CZ", "HU"] |
Array of allowed countries in ISO 3166-1 alpha-2 code, e.g. SK ,CZ etc. |
ips | Array | Array of allowed IPs in format 1.2.3.0/24 or 1.2.3.4 |
||
note | string | Your note |
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account" -v -u key:signature -H "Content-Type: application/json" -H "Date: request_date_time" -X PUT \ -d '{"login": "foo", "password": "testpassword", "ftpEnabled": false, "sshEnabled": false, "ipCheck": true, "ips": ["1.2.3.4", "8.8.8.8"], "countryCheck": false, "countries": [ "SK", "CZ", "HU" ], "note": "API test"}'
Request
PUT https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account HTTP/1.1 Accept: application/json Content-Type: application/json { "login": "foo", "password": "testpassword", "ftpEnabled": false, "sshEnabled": false, "ipCheck": true, "ips": ["1.2.3.4", "8.8.8.8"], "countryCheck": false, "countries": [ "SK", "CZ", "HU" ], "note": "API test" }
Response
200
{ "status": "success", "item": { "id": 614561, "createTime": 1621254987, "hostingId": 1305518, "login": "foo.testingdomain.sk", "dir": "/", "disabled": false, "ftpEnabled": false, "sshEnabled": false, "countryCheck": false, "ipCheck": true, "countries": [ "CZ", "SK", "HU" ], "ips": [], "note": "API test" } }
Validation error
200
{ "status": "error", "errors": { "login": [ "Login already used." ], "password": [ "This field is required." ] } }
Name | Type | Required | Default | Comment |
---|---|---|---|---|
login | string | yes | FTP login foo for foo.testingdomain.sk |
|
password | string | yes | FTP password | |
dir | string | no | / |
Enable access to directory |
disabled | boolean | no | Deactivate account | |
ftpEnabled | boolean | no | true |
Enable FTP |
sshEnabled | boolean | no | Enable SFTP | |
countryCheck | boolean | no | false |
Enable access to selected countries |
ipCheck | boolean | no | false |
Enable access to selected IP addresses |
countries | Array | no | ["SK", "CZ", "HU"] |
Array of allowed countries in ISO 3166-1 alpha-2 code, e.g. SK ,CZ etc. |
ips | Array | Array of allowed IPs in format 1.2.3.0/24 or 1.2.3.4 |
||
note | string | Your note |
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account/:ftpAccountId" -v -u key:signature -H "Content-Type: application/json" -H "Date: request_date_time" -X POST \ -d '{"login": "foo", "password": "testpassword", "ftpEnabled": false, "sshEnabled": false, "ipCheck": true, "ips": ["1.2.3.4", "8.8.8.8"], "countryCheck": false, "countries": [ "SK", "CZ", "HU" ], "note": "API test"}'
Request
POST https://rest.websupport.sk/v1/user/:userId/hosting/:hostingId/ftp-account/:ftpAccountId HTTP/1.1 Accept: application/json Content-Type: application/json { "login": "foo", "password": "testpassword", "ftpEnabled": false, "sshEnabled": false, "ipCheck": true, "ips": ["1.2.3.4", "8.8.8.8"], "countryCheck": false, "countries": [ "SK", "CZ", "HU" ], "note": "API test" }
Response
200
{ "status": "success", "item": { "id": 614561, "createTime": 1620907956, "hostingId": 1305518, "login": "foo.testingdomain.sk", "dir": "/", "disabled": false, "ftpEnabled": false, "sshEnabled": false, "countryCheck": false, "ipCheck": true, "countries": [ "CZ", "HU", "SK" ], "ips": [], "note": "API test" } }
Validation error
200
{ "status": "error", "errors": { "login": [ "Login already used." ] } }
No parameters required.
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/:hostngId/ftp-account/:ftpAccountId" -X DELETE -u key:signature -H "Date: request_date_time"
Request
DELETE https://rest.websupport.sk/v1/user/:userId/hosting/:hostngId/ftp-account/:ftpAccountId HTTP/1.1 Accept: application/json
Response
200
{ "status": "success", "item": { "id": 614561, "createTime": 1620908851, "hostingId": 1305518, "login": "foo.testingdomain.sk", "dir": "/", "disabled": false, "ftpEnabled": true, "sshEnabled": true, "countryCheck": true, "ipCheck": true, "countries": [ "HU", "CZ", "SK" ], "ips": [], "note": "test API" } }
No parameters required.
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/shell" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:userId/hosting/shell HTTP/1.1 Accept: application/json
Response
200
{ "foo.sk": { "login": "foo", "password": "testpassword", "ssh_port": 22, "host": "shell.r6", "port": 24700, "url": "https://shell.r6.websupport.sk:24700", "premium": true, "status": "active", "create_time": 1719564311, "delete_time": null }, "bar.sk": { "login": "bar", "password": "testpassword", "ssh_port": 22, "host": "shell.r6", "port": 24700, "url": "https://shell.r6.websupport.sk:24700", "premium": false, "status": "active", "create_time": 1719564311, "delete_time": 1719570983 } }
No parameters required.
Curl
curl "https://rest.websupport.sk/v1/user/:userId/hosting/shell/:domain" -v -u key:signature -H "Date: request_date_time"
Request
GET https://rest.websupport.sk/v1/user/:userId/hosting/shell/:domain HTTP/1.1 Accept: application/json
Response
200
{ "login": "foo", "password": "testpassword", "ssh_port": 22, "host": "shell.r6", "port": 24700, "url": "https://shell.r6.websupport.sk:24700", "premium": true, "status": "active", "create_time": 1719564311, "delete_time": null }
Response
404
{ "message": "Domain not found", "code": 404 }