跳转至

presets.php

Server preset management module: retrieving lists, grouping, searching for suitable servers, and detailed configurations with prices in different currencies.

API Methods

Method Action Description
groups get groups Returns a list of available preset groups
info get currency info Returns a list of available currencies for displaying preset prices. By default, it returns EUR and RUB.
list get presets list Returns a list of available server presets with filtering by location and access rights
search search servers Returns a list of servers matching the specified preset parameters (name, location, search area)
show get preset Returns information about a preset by ID or name. Supports filtering and limits.

presets/groups

Returns a list of available preset groups

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Action name: groups
token string Authorization token

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=groups" \
--data "token=YOUR_TOKEN"
Example of a successful response
{
"result": "OK",
"action": "groups",
"data": []
}
Failure response

``` { "code": -1, "message": "Error getting preset groups" }

```

presets/info

Returns a list of available currencies for displaying preset prices. By default, it returns EUR and RUB.

HTTP-method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: info
token string Authorization token
currencies string List of currencies separated by commas (e.g.: USD,EUR)

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X GET \
--data "action=info"
Example of a successful response
{
"result": "OK",
"action": "info",
"presets": [
{
"Code": "NL",
"amount": 49.99,
"available": 10,
"component_id": 5,
"price": {
"EUR": 49.99,
"RUB": 5000
},
"server_type": "standard",
"tags": [
{
"id": 1,
"name": "high-cpu"
}
]
}
]
}
Failure response

``` { "code": -1, "message": "Invalid request" }

```

presets/list

Returns a list of available server presets with filtering by location and access rights

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: list
token string Authorization token. If provided, access rights are checked. If not provided or invalid, public mode is used (the total field is removed).
location string Filter by location (e.g., NL, EU-Central). Default is 'NL'.

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=list"
Example of a successful response
{
"result": "OK",
"action": "list",
"presets": [
{
"id": 101,
"name": "VPS Basic",
"description": "Basic virtual server",
"cpu": 2,
"ram": 4096,
"hdd": 50,
"gpu": null,
"virtual": 1,
"active": 1,
"locations": "NL,DE",
"price": {
"EUR": 15.0,
"RUB": 1500.0,
"USD": 16.5
},
"monthly_ru": 1500,
"monthly_com": 15,
"monthly_usd": 16.5,
"internal": 0,
"available": 5,
"total": 10,
"server_type": "Virtual Private Server",
"tags": [
{
"component_id": 101,
"tag": "example_tag",
"value": "example_value"
}
]
}
]
}
Failure response

``` { "code": -1, "message": "presets/list error: Database connection failed", "details": { "action": "list", "module": "presets" } }

```

presets/search

Returns a list of servers matching the specified preset parameters (name, location, search area)

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: search
token string Authorization token

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=search"
Example of a successful response
{
"result": "OK",
"action": "search",
"servers": [
{
"id": 123,
"name": "Standard Preset",
"cpu": "4 vCPU",
"ram": 8,
"hdd": 50,
"gpu": "",
"locations": [
"NL"
],
"price": {
"EUR": 25.0,
"RUB": 2500
},
"status": "active",
"available": 1
}
]
}
Failure response

``` { "code": -1, "message": "Authentication required" }

```

presets/show

Returns information about a preset by ID or name. Supports filtering and limits.

HTTP-method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: show
token string Authorization token. If provided, it checks access rights and filters content (e.g., blocking for certain regions).
id integer Preset ID for filtering.
name string Preset name for filtering.
limit integer Limit on the number of returned records.

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=show"
Example of a successful response
{
"result": "OK",
"action": "show",
"presets": [
{
"id": 123,
"name": "Standard VPS",
"description": "Basic configuration",
"active": 1,
"virtual": 0,
"cpu": "2 vCPU",
"ram": "4096",
"hdd": "80 SSD",
"gpu": null,
"locations": "NL,DE",
"locations_openstack": "",
"monthly_ru": 500,
"monthly_com": 1000,
"monthly_usd": 15,
"price": {
"EUR": 12.5,
"RUB": 1200,
"USD": 15.0
},
"tags": [
{
"id": 1,
"name": "popular"
}
],
"internal": 0,
"server_type": "vps",
"available": 1,
"total": 10,
"regions": {
"NL": "10+",
"DE": "5"
},
"hourly_usd": 0.025,
"hourly_com": 0.02,
"hourly_ru": 0.0083
}
]
}
Failure response

``` { "code": -1, "message": "JSON encode failed" }

question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×