Skip to content

hardware.php

Hardware management module for managing components, barcodes, storage lists, and hardware reports.


hardware/add_barcodes

Adds barcodes to hardware entities based on provided filters.

HTTP method: POST

Parameters:

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

Request example

curl -s "https://invapi.hostkey.com/hardware.php" -X POST \
--data "action=add_barcodes" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "add_barcodes",
"barcode": 123456789
}
Error examples
{
"code": -1,
"message": "Authentication required or invalid token"
}

hardware/delete_barcodes

Deletes a barcode associated with a specific entity ID.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: delete_barcodes
id ❌ integer The ID of the entity for which to delete the barcode.

Request example

curl -s "https://invapi.hostkey.com/hardware.php" -X POST \
--data "action=delete_barcodes" \
--data "id=123"
Success response example
{
"result": "OK",
"action": "delete_barcodes",
"barcode": 123
}
Error examples
{
"code": -1,
"message": "Error description"
}

hardware/list_barcodes

Returns a list of barcodes based on provided filters.

HTTP method: POST

Parameters:

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

Request example

curl -s "https://invapi.hostkey.com/hardware.php" -X POST \
--data "action=list_barcodes" \
--data "token=HOSTKEY_TOKEN"
Success response example
{
"result": "OK",
"action": "list_barcodes",
"module": "hardware",
"barcodes": [
{
"id": 1,
"barcode": "ABC-12345",
"entity_type": "component",
"entity_id": 10,
"created_at": "2024-01-01T12:00:00Z"
}
]
}
Error examples
{
"code": -1,
"message": "Authentication required or invalid token"
}

hardware/show_barcodes

Returns barcode information for a specific entity by its ID.

HTTP method: POST|GET

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: show_barcodes
id ❌ integer The ID of the entity for which to show barcodes.

Request example

curl -s "https://invapi.hostkey.com/hardware.php" -X POST|GET \
--data "action=show_barcodes" \
--data "id=123"
Success response example
{
"result": "OK",
"action": "show_barcodes",
"barcode": 1234567890
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}

hardware/update_barcodes

Updates barcode information for a specific entity or based on filtered criteria.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: update_barcodes
token ✅ string Authentication token.
id ❌ integer The ID of the entity to update barcodes for.

Request example

curl -s "https://invapi.hostkey.com/hardware.php" -X POST \
--data "action=update_barcodes" \
--data "token=HOSTKEY_TOKEN" \
--data "id=123"
Success response example
{
"result": "OK",
"action": "update_barcodes",
"barcode": 123
}
Error examples
{
"code": -1,
"message": "Action is not recognized"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×