Skip to content

leasing_contracts.php

Leasing contracts management module for handling contract creation, updates, server binding, and retrieval of associated servers.

API Methods

Method Action Description
create create contract Creates a new leasing contract
delete delete contract Unbinds servers and deletes the specified leasing contract
get get contract Retrieves details of a specific leasing contract
list get list Returns a list of leasing contracts
show_servers get bound servers Returns a list of server IDs associated with the contract
update update contract Updates an existing leasing contract and re-syncs bound servers
update_server_list update bound servers Updates the list of servers associated with a contract

leasing_contracts/list

Returns a list of leasing contracts

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: list

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=list"
Success response example
{
"result": "OK",
"action": "list",
"contracts": [
{
"id": 123,
"company_id": 5,
"created_at": "2024-01-15T10:30:00Z"
}
]
}
Error examples
{
"code": -1,
"message": "Error description"
}

leasing_contracts/get

Retrieves details of a specific leasing contract

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: get
token ✅ string Authentication token
id ✅ integer Leasing contract ID

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=get" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Success response example
{
"result": "OK",
"action": "get",
"contract": {
"id": 123,
"company_id": 5,
"status": "active"
}
}
Error examples
{
"code": 400,
"message": "Please provide id"
}

leasing_contracts/update

Updates an existing leasing contract and re-syncs bound servers

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: update
token ✅ string Authentication token
id ✅ integer Leasing contract ID
params ✅ object Contract update parameters

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=update" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE" \
--data "params=VALUE"
Success response example
{
"result": "OK",
"action": "update",
"contract": {
"id": 123,
"company_id": 5,
"status": "active"
}
}
Error examples
{
"code": 400,
"message": "Please provide id and params"
}

leasing_contracts/create

Creates a new leasing contract

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: create
token ✅ string Authentication token

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=create" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "create",
"contract": {
"id": 124,
"company_id": 5,
"status": "active"
}
}
Error examples
{
"code": 400,
"message": "Please provide params"
}

leasing_contracts/delete

Unbinds servers and deletes the specified leasing contract

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: delete
token ✅ string Authentication token
id ✅ integer Leasing contract ID

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=delete" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Success response example
{
"result": "OK",
"action": "delete"
}
Error examples
{
"code": 400,
"message": "Please provide id"
}

leasing_contracts/show_servers

Returns a list of server IDs associated with the contract

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: show_servers
token ✅ string Authentication token
id ✅ integer Leasing contract ID

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=show_servers" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE"
Success response example
{
"result": "OK",
"action": "show_servers",
"servers": [
101,
102,
103
]
}
Error examples
{
"code": 400,
"message": "Please provide id"
}

leasing_contracts/update_server_list

Updates the list of servers associated with a contract

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: update_server_list
token ✅ string Authentication token
id ✅ integer Leasing contract ID
params[servers] ✅ array<string> List of server IDs to bind to the contract.
params[servers], [] ✅ array<string> List of server IDs to bind to the contract. Accepts multiple values: params[servers], []=101&params[servers], []=102
servers ✅ string Параметр servers

Request example

curl -s "https://invapi.hostkey.com/leasing_contracts.php" -X POST \
--data "action=update_server_list" \
--data "token=HOSTKEY_TOKEN" \
--data "id=123" \
--data "params[servers][]=101" \
--data "params[servers][]=102" \
--data "servers=VALUE"
Success response example
{
"result": "OK",
"action": "update_server_list"
}
Error examples
{
"code": 400,
"message": "Please provide id and params"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×