Rhr
API Methods¶
| Method | Action | Description |
|---|---|---|
add | create request | Creates a new Remote Hands Request (RHR) specifying the type and equipment. |
chat | add message to chat | Adds a client-visible message to the request history. |
discard | cancel request | Recursively changes the request status to canceled or closed. |
list | get request list | Returns a list of available RHR tasks with filtering by location, status, and date. |
rhr/add¶
Creates a new Remote Hands Request (RHR) specifying the type and equipment.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: add |
| token | ✅ | string | Authorization token |
| params[type] | ✅ | string | Request type (KVM, UNBLOCK, SERVICE) |
| params[eq_id] | ✅ | int | ID of the equipment for which the request is created |
| params[request_origin] | ❌ | string | Request source (CLIENT or INTERNAL). For clients, this is ignored and forced to CLIENT. |
| params[order_data] | ❌ | object | Order data in JSON string format |
Example Request
Example of a successful response
{
"result": "OK",
"module": "rhr",
"action": "add",
"requests": [
{
"id": 12345,
"eq_id": 67890,
"type": "KVM",
"status": "PENDING",
"request_origin": "CLIENT",
"priority": "NORMAL",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"eq_location": "AMS",
"eq_name": "server-01",
"request": "Reboot server",
"assignee": null,
"ticket": null
}
]
}
Failure response
rhr/chat¶
Adds a client-visible message to the request history.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: chat |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Request ID |
| message | ✅ | string | Message text |
Example Request
Example of a successful response
{
"result": "OK",
"module": "rhr",
"action": "chat",
"history": [
{
"id": 98765,
"component_id": 12345,
"type": "CLIENT",
"message": "Server rebooted, thank you",
"created_at": "2024-01-15T11:00:00Z",
"tags": []
}
],
"requests": [
{
"id": 12345,
"eq_id": 67890,
"type": "KVM",
"status": "ACTIVE",
"request_origin": "CLIENT",
"priority": "NORMAL",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T11:00:00Z",
"eq_location": "AMS",
"eq_name": "server-01",
"request": "Reboot server",
"assignee": "admin",
"ticket": null
}
]
}
rhr/discard¶
Recursively changes the request status to canceled or closed.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: discard |
| token | ✅ | string | Authorization token |
| id | ✅ | int | Request ID |
| params[response] | ❌ | string | Cancellation comment |
Example Request
Example of a successful response
{
"result": "OK",
"module": "rhr",
"action": "discard",
"history": [
{
"id": 98766,
"component_id": 12345,
"type": "CLIENT",
"message": "Request canceled by user",
"created_at": "2024-01-15T12:00:00Z",
"tags": []
}
],
"requests": [
{
"id": 12345,
"eq_id": 67890,
"type": "KVM",
"status": "CANCELED",
"request_origin": "CLIENT",
"priority": "NORMAL",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T12:00:00Z",
"eq_location": "AMS",
"eq_name": "server-01",
"request": "Reboot server",
"assignee": "admin",
"ticket": null
}
]
}
rhr/list¶
Returns a list of available RHR tasks with filtering by location, status, and date.
HTTP Method: POST
Parameters:
| Parameter | Required | Type | Description |
|---|---|---|---|
| action | ✅ | string | Method identifier: list |
| token | ✅ | string | Authorization token |
| params[location] | ❌ | string | Filter by location (e.g., AMS, NY) |
| params[status] | ❌ | array<string> | Filter by statuses (PENDING, ACTIVE, SOLVED, etc.) |
| params[date_from] | ❌ | string | Start date for filtering (YYYY-MM-DD) |
| params[date_to] | ❌ | string | End date for filtering (YYYY-MM-DD) |
| params[date] | ❌ | array<string> | Array of dates for filtering |
| params[deleted] | ❌ | boolean | Whether to show deleted requests |
| params[eq_id] | ❌ | array<int> | Filter by equipment ID |
| params[type] | ❌ | string | Filter by request type (KVM, SERVICE, etc.) |
| params[request_origin] | ❌ | string | Filter by request source (CLIENT, INTERNAL) |
| params[request_owner] | ❌ | string | Filter by request owner (email) |
| params[id] | ❌ | array<int> | Filter by request IDs |
Example Request
curl -s "https://api.hostkey.com/rhr.php" -X POST \
--data "action=list" \
--data "token=HOSTKEY_TOKEN" \
--data "params[location]=AMS" \
--data "params[status][]=PENDING" \
--data "params[status][]=ACTIVE" \
--data "params[date_from]=2024-01-01" \
--data "params[date_to]=2024-01-31" \
--data "params[eq_id][]=67890" \
--data "params[eq_id][]=67891"
Example of a successful response
{
"result": "OK",
"module": "rhr",
"action": "list",
"history": [],
"requests": [
{
"id": 12345,
"eq_id": 67890,
"type": "KVM",
"status": "PENDING",
"request_origin": "CLIENT",
"priority": "NORMAL",
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z",
"eq_location": "AMS",
"eq_name": "server-01",
"request": "Reboot server",
"assignee": null,
"ticket": null,
"date_created": "2024-01-15T10:30:00Z",
"date_assigned": null,
"date_started": null,
"date_resolved": null,
"date_closed": null,
"date_failed": null,
"resolved_by": null
}
]
}