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 the list of available preset groups.
info get info Returns detailed information about a specific preset including pricing, availability, and tags.
list get list of presets Returns a list of all available presets. If a valid token is provided, the 'total' field is removed from each preset object for public access.
search get search results Search appropriate servers for a specific preset by name, filtering by scope (free or all) and location.
show get preset details Returns the configuration and pricing details of a specific preset by its ID.

presets/groups

Returns the list of available preset groups.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: groups
token string Authentication token

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=groups" \
--data "token=7bc29eb23fb1b879b21fce509597f07c"
Example of a successful response
{
"result": "OK",
"action": "groups",
"data": [
{
"id": 1,
"name": "Standard VPS"
},
{
"id": 2,
"name": "High Performance"
}
]
}
Failure response
{
"code": -1,
"message": "action required"
}

presets/info

Returns detailed information about a specific preset including pricing, availability, and tags.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Action name
token string Authentication token
id integer Preset ID

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=info"
Example of a successful response
{
"result": "OK",
"action": "info",
"data": {
"id": 123,
"name": "Standard VPS Plan",
"active": 1,
"virtual": 1,
"price": {
"RUB": 500.0,
"USD": 5.5,
"COM": 4.99
},
"available": 10,
"total": 100,
"tags": [
{
"id": 1,
"name": "ssd"
},
{
"id": 2,
"name": "high-cpu"
}
]
}
}
Failure response
{
"code": -1,
"message": "action required"
}

presets/list

Returns a list of all available presets. If a valid token is provided, the 'total' field is removed from each preset object for public access.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string Method identifier: list
token string Authentication token to check customer permissions

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": "Standard VPS",
"cpu": 2,
"ram": 4096,
"hdd": 51200,
"gpu": 0,
"virtual": 1,
"monthly_ru": 500.0,
"monthly_com": 15.0,
"monthly_usd": 18.5,
"price": {
"EUR": 16.5,
"USD": 18.5
},
"locations": [
"NL",
"DE"
],
"description": "High performance VPS instance",
"available": 0,
"total": 0,
"server_type": "Instant Server",
"tags": []
}
]
}
Failure response
{
"code": -1,
"message": "presets/list: no presets found"
}

presets/search

Search appropriate servers for a specific preset by name, filtering by scope (free or all) and location.

HTTP Method: POST

Parameters:

Parameter Required Type Description
action string The action to perform
token string Authentication token
name string Name of the preset to search for

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=search" \
--data "token=YOUR_TOKEN" \
--data "name=preset_name"
Example of a successful response
{
"result": "OK",
"action": "search",
"servers": [
{
"id": 1,
"server_id": 1,
"type": "ref_tableName",
"owner": "owner",
"status": "Condition_Component",
"location": "dataCenterLocation.Code",
"config": "hwconfig",
"full_location": "Rack1.description-pos-id",
"ip": "IpAdress2.ip",
"days_left": 0,
"due_date": "string"
}
]
}
Failure response
{
"code": -1,
"message": "action required"
}

presets/show

Returns the configuration and pricing details of a specific preset by its ID.

HTTP Method: POST|GET

Parameters:

Parameter Required Type Description
action string The action to perform
token string Authentication token
id integer The ID of the preset to show

Example Request

curl -s "https://invapi.hostkey.com/presets.php" -X POST \
--data "action=show" \
--data "id=123"
Example of a successful response
{
"result": "OK",
"action": "show",
"data": [
{
"id": 123,
"name": "High Performance Preset",
"description": "Optimized for heavy workloads",
"cpu": 4,
"ram": 8,
"hdd": 100,
"internal": 50,
"gpu": "NVIDIA RTX 3060",
"virtual": true,
"locations": [
"NL",
"DE"
],
"regions": {
"Code": "10+"
},
"monthly_ru": 2500.0,
"monthly_com": 45.99,
"monthly_usd": 52.5,
"price": {
"RUB": 2500.0,
"EUR": 45.99,
"USD": 52.5
},
"tags": [
{
"id": 1,
"name": "gaming"
}
],
"server_type": "Instant Server"
}
]
}
Failure response
{
"code": -1,
"message": "$module: action required"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×