get_task_messages

To load task messages for units, use the messages/get_task_messages method.

To get task messages, you need the View object and its basic properties and Request reports and messages access rights to the units. The Tasks service must be enabled and active for the account.

Endpoint

Copied!
svc=messages/get_task_messages&params={
	"itemIds": [<long>],
	"timeFrom":<uint>,
    "timeTo":<uint>,
    "loadCount":<uint>
}

Request example

Copied!
https://hst-api.wialon.com/wialon/ajax.html?sid=SESSION_IDENTIFIER&svc=messages/get_task_messages&params={       
        "itemIds":[1546, 1545],
        "timeFrom": 1724347800,
        "timeTo": 1724693399,
        "loadCount": 10000
}

Parameters

The following parameters are required:

Name Description
itemIds Array of unit IDs for which task messages are requested.
timeFrom The beginning of the time interval (Unix time, UTC).
timeTo The end of the time interval (Unix time, UTC). Must be greater than or equal to timeFrom.
loadCount Number of messages to return. The maximum number is 20000.

Response

If the request is completed successfully, the response contains the number of task messages and the array of messages.

Copied!
{
    "count": 1,
    "messages": [
        {
            "item_id": 1546,
            "t": 1724420460,
            "f": 1536,
            "tp": "task",
            "et": "adf",
            "x": 0,
            "y": 0,
            "rt": 1724420493,
            "p": {
                "task_sub_type": 21,
                "task_reg_type": 1,
                "task_evt_name": "Custom task",
                "task_id": "b1978b93a308c5c3be0697223bf0c5002ee87de02ce7937b23a34830516c330466c8916c",
                "task_update_time": 1724420460,
                "task_status": 6,
                "task_priority": 2,
                "task_assignee": 0,
                "task_description": "VHS Glitch violated speed limitations.",
                "task_tags": "{\"SPEED\":\"25 km/h\",\"POS_TIME\":\"10.07.2025 15:52:28\",\"UNIT\":\"VHS Glitch\"}",
                "task_comments": "[]",
                "task_account": 1063,
                "task_address_x": 56.65078,
                "task_address_y": 53,
                "task_done_rejected": 1752152438,
                "task_params": {}
            }
        }
    ]
}

If the request is not completed, an error code is returned.

Error codes

Error code Description
4 Invalid input parameters (for example, timeFrom > timeTo, or missing required fields).
5 Request execution error.
7 Access denied. No required access rights to the units or the Tasks service is not enabled or active.
1004 The maximum number of messages (loadCount) is exceeded.

If you find a mistake in the text, please select it and press Ctrl+Enter.