Skip to content

employees.php

Employees management module for retrieving employee history and adding new historical log entries.

API Methods

Method Action Description
add_history Add a history records for a given entity ID. Adds a new history record to the log for a specific entity.
history Retrieve history records for a given [list of] entity ID's. Retrieves historical log entries filtered by type and date.

employees/add_history

Adds a new history record to the log for a specific entity.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: add_history
token ✅ string Authorization token.
id ✅ integer The ID of the entity to which the history record will be attached.
message ✅ string The message content for the history log entry.

Request example

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

employees/history

Retrieves historical log entries filtered by type and date.

HTTP method: POST

Parameters:

Parameter Required Type Description
action ✅ string Method identifier: history
token ✅ string Authorization token.
id ✅ integer The ID of the entity for which to retrieve history.
type ❌ array<string> Filter by history record types. Accepts multiple values: type[]=val1&type[]=val2
date_from ❌ string Filter records from this date onwards.

Request example

curl -s "https://invapi.hostkey.com/employees.php" -X POST \
--data "action=history" \
--data "token=HOSTKEY_TOKEN" \
--data "id=VALUE" \
--data "type[]=val1" \
--data "type[]=val2"
Success response example
{
"result": "OK",
"action": "history",
"history": [
{
"id": 1001,
"type": "note",
"message": "History entry example",
"created_at": "2024-05-20T12:00:00Z"
}
]
}
Error examples
{
"code": 401,
"message": "Authorization required"
}
question_mark
Is there anything I can help you with?
question_mark
AI Assistant ×