get_task_messages
The messages/get_task_messages request allows you to load registered event messages for all units to which you have the View object and its basic properties access rights.
svc=messages/get_task_messages¶ms={
"itemIds": [<long>],
"timeFrom":<uint>,
"timeTo":<uint>,
"loadCount":<uint>
}
Request example:
https://hst-api.wialon.com/wialon/ajax.html?sid=b8c179f636baedfd43e1890bd48a8ee9&svc=messages/get_task_messages¶ms={
"itemIds":[1546, 1545],
"timeFrom": 1724347800,
"timeTo": 1724693399,
"loadCount": 10000
}
Parameters
The following parameters are required:
Name | Description |
itemIds | The IDs of the units. |
timeFrom | The beginning of the interval. |
timeTo | The end of the interval. |
loadCount | Number of messages to return. The maximum number is 20000. |
Response
Example of a response when the request is completed successfully:
{
"count": 5,
"messages": [
{
"item_id": 1546,
"t": 1724420460,
"f": 1536,
"tp": "evt",
"et": "adf",
"x": 0,
"y": 0,
"rt": 1724420493,
"p": {
"task_sub_type": 21,
"task_reg_type": 1,
"task_evt_name": "Custom event",
"task_id": "b1978b93a308c5c3be0697223bf0c5002ee87de02ce7937b23a34830516c330466c8916c",
"task_update_time": 1724420460,
"task_status": 1,
"task_priority": 2,
"task_assignee": 0,
"task_comments": "[]",
"task_account": 1063
}
},
{
"item_id": 1546,
"t": 1724420460,
"f": 1536,
"tp": "evt",
"et": "adf",
"x": 0,
"y": 0,
"rt": 1724420497,
"p": {
"task_sub_type": 21,
"task_reg_type": 1,
"task_evt_name": "Custom event",
"task_id": "c52f1f15dd9a2c5b3258102cde5ad75a24b76820b4cf0d2438c835d796a2fd5966c8916c",
"task_update_time": 1724420460,
"task_status": 1,
"task_priority": 2,
"task_assignee": 0,
"task_comments": "[]",
"task_account": 1063
}
},
{
"item_id": 1546,
"t": 1724420460,
"f": 1536,
"tp": "evt",
"et": "adf",
"x": 0,
"y": 0,
"rt": 1724420496,
"p": {
"task_sub_type": 21,
"task_reg_type": 1,
"task_evt_name": "Custom event",
"task_id": "cec6ce7c7bb4ae44304494eb6659e2952ad3ca0dab62093e2482403d62b1157466c8916c",
"task_update_time": 1724420460,
"task_status": 1,
"task_priority": 2,
"task_assignee": 0,
"task_comments": "[]",
"task_account": 1063
}
},
{
"item_id": 1546,
"t": 1724420460,
"f": 1536,
"tp": "evt",
"et": "adf",
"x": 0,
"y": 0,
"rt": 1724420494,
"p": {
"task_sub_type": 21,
"task_reg_type": 1,
"task_evt_name": "Custom event",
"task_id": "7674dbcfae5776e0847d7239401c0b9384a99226c0245b9501ba8917b38e8d6b66c8916c",
"task_update_time": 1724420460,
"task_status": 1,
"task_priority": 2,
"task_assignee": 0,
"task_comments": "[]",
"task_account": 1063
}
},
{
"item_id": 1546,
"t": 1724420460,
"f": 1536,
"tp": "evt",
"et": "adf",
"x": 0,
"y": 0,
"rt": 1724420495,
"p": {
"task_sub_type": 21,
"task_reg_type": 1,
"task_evt_name": "Custom event",
"task_id": "e15b634b9750481a951ffac6bbbbd76411669aa829c78c925b5b2f08b3f5a77066c8916c",
"task_update_time": 1724420460,
"task_status": 1,
"task_priority": 2,
"task_assignee": 0,
"task_comments": "[]",
"task_account": 1063
}
}
]
}
If the request is not completed, an error code is returned.
Error codes
Error code | Description |
4 | Invalid input parameters. |
5 | Request execution error. |
7 | Access denied. The View object and its basic properties access rights to the units is required. |
1004 | The maximum number of messages (loadCount) is exceeded. |