Skip to content

presets.php

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

API Methods

Method Action Description
groups get groups Returns a list of available preset groups
info get info Returns a list of available currencies for displaying preset prices
list get preset list Returns a list of available presets, considering location and user permissions
search search servers by preset Returns a list of suitable servers based on the preset name, scope (free/all), and location
show get preset info Returns detailed information about a specific preset by its ID or name, taking into account restrictions for certain regions and payment parameters.

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"
Example of a successful response
{
"result": "OK",
"action": "groups",
"data": [
{
"id": 1,
"name": "Standard Group"
}
]
}
Failure response

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

```

presets/info

Returns a list of available currencies for displaying preset prices

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": []
}
Failure response

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

```

presets/list

Returns a list of available presets, considering location and user permissions

HTTP-method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: list
token string Authorization token
location string Location code (e.g., NL)

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X GET \
--data "action=list"
Example of a successful response
{
"result": "OK",
"action": "list",
"presets": [
{
"id": 1,
"name": "example",
"price": {
"EUR": 49.99,
"USD": 55.56
},
"available": 10,
"total": 100,
"server_type": "standard",
"tags": [
{
"id": 1,
"name": "high-performance"
}
]
}
]
}
Failure response

``` { "code": -1, "message": "presets/list error: no presets found" }

```

presets/search

Returns a list of suitable servers based on the preset name, scope (free/all), and location

HTTP-method: POST|GET

Parameters:

Parameter Required Type Description
action string Method identifier: search
token string Authorization token
name string Preset name
scope string Scope (free/all)
location string Server location

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=search" \
--data "token=HOSTKEY_TOKEN" \
--data "name=VALUE"
Example of a successful response
{
"result": "OK",
"action": "search",
"servers": [
{
"id": 123,
"server_id": 123,
"type": "Component1.ref_tableName",
"owner": "string",
"status": "string",
"location": "string",
"config": "string",
"full_location": "string",
"ip": "string",
"days_left": 30,
"due_date": "2024-12-31T23:59:59Z"
}
]
}
Failure response

``` { "code": -1, "message": "$module/search: invalid token, logout" }

```

presets/show

Returns detailed information about a specific preset by its ID or name, taking into account restrictions for certain regions and payment parameters.

HTTP-method: GET

Parameters:

Parameter Required Type Description
action string Method identifier: show
token string User authorization token
id integer Preset ID
name string Preset name
limit integer Results limit

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X GET \
--data "action=show"
Example of a successful response
{
"result": "OK",
"action": "show",
"presets": [
{
"id": 123,
"name": "High Performance",
"cpu": "4 Cores",
"ram": 16,
"hdd": 500,
"gpu": "NVIDIA RTX 3080",
"virtual": true,
"description": "Powerful preset for gaming",
"locations": [
"NL",
"DE"
],
"monthly_eur": 45.0,
"monthly_com": 55.0,
"monthly_usd": 60.0,
"hourly_usd": 0.0382,
"hourly_com": 0.0382,
"hourly_eur": 0.41,
"regions": {
"NL": "10+"
},
"server_type": "Instant Server",
"tags": [
{
"id": 1,
"name": "gaming"
}
]
}
]
}
Failure response

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

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