### Full Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/get_zones_by_unit A complete HTTP GET request example including authentication and parameters. ```text https://hst-api.wialon.com/wialon/ajax.html?svc=resource/get_zones_by_unit&sid=0b149aca05cd00ee2c7658124f5248fe¶ms={"spec":{"zoneId":{"912":[4,5,6,7,8,9],"913":[1,2,3,4,5,76]},"units":[917],"time":0}} ``` -------------------------------- ### Get Virtual Command Queue Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_vrt_command_queue A concrete example of the request using a specific unit ID. ```http svc=unit/get_vrt_command_queue¶ms={"itemId": 132343} ``` -------------------------------- ### unit/send_cmd Example Request Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/send_cmd A concrete example of a unit/send_cmd request. ```text svc=unit/send_cmd¶ms={"itemId":1351,"commandName":"pin","linkType":"","param":"pin 0000","timeout":60,"flags":0} ``` -------------------------------- ### Example Request for get_video_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_video_settings A concrete example of the request using a specific unit ID. ```text svc=unit/get_video_settings¶ms={"itemId":200334} ``` -------------------------------- ### HTTP GET request example Source: https://help.wialon.com/en/api/user-guide/api-reference/messages/get_task_messages A concrete example of an API call using a session ID and specific parameters. ```http 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 } ``` -------------------------------- ### Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_task A complete URL-based request example for updating task status and priority. ```text https://hst-api.wialon.com/wialon/ajax.html?sid=5e860dbe24e3d704ffb196d0733ec714&svc=unit/update_task¶ms={ "itemId": 1514, "taskId": "6f6aeeebad9ebe64bda86924f8d379d8e6b06bd690c53da4aab526c5e221bdb266b52a50", "props": { "task_status": 2, "task_priority": 3 } } ``` -------------------------------- ### Example request for update_activity_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_activity_settings A concrete example of the request format with specific values for itemId and type. ```text svc=unit/update_activity_settings¶ms={ "itemId": 20334, "type": 1 } ``` -------------------------------- ### Example request for unit/get_device_commands_extended_new Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_device_commands_extended_new A concrete example of the request using specific protocol and device type identifiers. ```http svc=unit/get_device_commands_extended_new¶ms={"protocolId":1, "deviceTypeId":411} ``` -------------------------------- ### Date Format Parameter Example Source: https://help.wialon.com/en/api/user-guide/api-reference/render/set_locale An example of the formatDate parameter string. ```json "formatDate":"%Y-%m-%E %H:%M:%S" ``` -------------------------------- ### Basic sensor configuration example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_sensor A minimal example showing how to set the popup visibility and list position for a sensor. ```json "c":"{\"appear_in_popup\":true,\"pos\":1,\"ci\":{}}" ``` -------------------------------- ### Request Endpoint and Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_deleted_reasons The request is performed via a GET or POST call to the unit/get_deleted_reasons service with empty parameters. ```text svc=unit/get_deleted_reasons ¶ms={ } ``` ```text svc=unit/get_deleted_reasons¶ms={} ``` -------------------------------- ### Update Speed Settings Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_speed_settings A concrete example of the request parameters for updating unit speed settings. ```text svc=unit/update_speed_settings¶ms={ "itemId": 1583, // Unit ID. "speedParameter": "speed", // Parameter used to determine speed. "speedMeasure": 0 // Speed measurement system (for example, 0 for km/h, 1 for mph). } ``` -------------------------------- ### Example Request for add_video_packets Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/add_video_packets A concrete example of the request format with specific unit IDs and packet count. ```text svc=unit/add_video_packets¶ms={"units":[5523461,1548776],"packets":1} ``` -------------------------------- ### Example Request for unit/get_activity_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_activity_settings A concrete example of the request targeting a unit with ID 200393. ```text svc=unit/get_activity_settings¶ms={"itemId": 200393} ``` -------------------------------- ### Reset Virtual Command Queue Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/reset_vrt_command_queue A concrete example of the request using a specific unit ID. ```http svc=unit/reset_vrt_command_queue¶ms={"itemId": 132343} ``` -------------------------------- ### Example Request for unit/update_video_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_video_settings A concrete example of a request to update video settings for two cameras on a specific unit. ```text svc=unit/update_video_settings¶ms={"itemId":45644,"settings":"settings":[{"name":"Camera 1","flags":1},{"name":"Camera 2","flags":1}]} ``` -------------------------------- ### Multipart POST Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/upload_driver_image Example of a multipart/form-data POST request used to upload a driver image. ```http Request URL: https://hst-api.wialon.com/wialon/ajax.html?svc=resource/upload_driver_image Request Method: POST Host: hst-api.wialon.com Connection: keep-alive Content-Length: 31755 Cache-Control: no-cache Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryB4wasXYYHLTNXHBl Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru,en-US;q=0.8,en;q=0.6 ------WebKitFormBoundaryB4wasXYYHLTNXHBl Content-Disposition: form-data; name="params" {"itemId":717314,"driverId":17,"eventHash":"jUploadForm1372768554999"} ------WebKitFormBoundaryB4wasXYYHLTNXHBl Content-Disposition: form-data; name="eventHash" jUploadForm1372768554999 ------WebKitFormBoundaryB4wasXYYHLTNXHBl Content-Disposition: form-data; name="drivers_dlg_props_upload_image"; filename="image.jpg" Content-Type: image/jpeg ------WebKitFormBoundaryB4wasXYYHLTNXHBl-- ``` -------------------------------- ### Example request for unit/update_event_data Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_event_data A concrete example of a request to update event data for a unit. ```text svc = unit/update_events & params = { "events": [ { "itemId": 1555, "resourceId": 123, "eventType": "lls", "timeFrom": 1689734883, "timeTo": 1689734883, "params": { "test1": 1 } } ] } ``` -------------------------------- ### Example request for unit/get_billing_code Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_billing_code A concrete example of a request targeting a specific unit ID. ```text svc=unit/get_billing_code¶ms={"itemId":1133} ``` -------------------------------- ### Example request for update_video_status Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_video_status A concrete example of the request parameters to enable video billing for two specific units. ```text svc=unit/update_video_status¶ms={ "units": [5523461, 1548776], "status": 1 } ``` -------------------------------- ### Filter parameter example Source: https://help.wialon.com/en/api/user-guide/api-reference/messages/get_messages An example of the filter string syntax using wildcards. ```json "filter":"pos.x,p.pre*,p.param?" ``` -------------------------------- ### Parameter p Object Example Source: https://help.wialon.com/en/api/user-guide/api-reference/token/update Example of passing a single object as a string for the custom parameters parameter. ```json "p":"{\"paramA\":\"valueB\"}" ``` -------------------------------- ### Response Examples Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_hw_params Expected response formats for various actions. ```json {} ``` ```json { "error": /* If the value is 0, the device has additional parameters. Any other value indicates no parameters. */ } ``` ```json {} ``` ```json [ { /* Parameter configuration.*/ "default":, /* Default value. */ "description":, /* Description. */ "label":, /* Name. */ "maxval":, /* Maximum value. */ "minval":, /* Minimum value. */ "name":, /* System name. */ "readonly":, /* Read only: 1 - yes, 0 - no. */ "type":, /* Type. */ "value": /* Value. */ } ] ``` -------------------------------- ### Spec Parameter Examples Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/get_zones_by_unit Examples of the zoneId, units, and time parameters used within the spec object. ```json "zoneId": { “912”: [4, 5, 6, 7, 8, 9], “913”: [1, 2, 3, 4, 5, 76] ``` ```json “units”: [917] ``` ```json “time”: 0 ``` -------------------------------- ### Multipart POST Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/exchange/convert_file An example of a multipart/form-data POST request used to upload a file for conversion. ```http Request URL: https://hst-api.wialon.com/wialon/ajax.html?svc=exchange/convert_file&sid=8157df114c0e601f0f31091c3c2ac53d Request Method: POST Connection: keep-alive Content-Length: 1901 Cache-Control: no-cache Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryhAXcAjtvh1D61XpC Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru,en-US;q=0.8,en;q=0.6 ------WebKitFormBoundaryhAXcAjtvh1D61XpC Content-Disposition: form-data; name="params" jUploadForm1372772377019 ------WebKitFormBoundaryhAXcAjtvh1D61XpC Content-Disposition: form-data; name="import_file"; filename="file.zip" Content-Type: application/zip ------WebKitFormBoundaryhAXcAjtvh1D61XpC-- ``` -------------------------------- ### Example request for unit/update_events Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_events A concrete example of a request to mark a fuel level event as false. ```text svc=unit/update_events¶ms={ "events": [ { "itemId": 1555, "resourceId": 123, "eventType": "lls", "timeFrom": 1689734883, "timeTo": 1689734883, "params": { "mark": 1 } } ] } ``` -------------------------------- ### Export Zones Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/exchange/export_zones An example JSON request body for exporting geofences. ```json {"fileName":"export_zones_result","zones":[{"itemId":,"id":}],"compress":0} ``` -------------------------------- ### Example Response for Search Items Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/reports-execution This is an example JSON response when searching for resources with specific report templates. Key fields include 'nm' for resource name and 'id' for system ID. ```json { "searchSpec":{ "itemsType":"avl_resource", "propName":"reporttemplates", "propValueMask":"Grouped trips", "sortType":"sys_name", propType:"propitemname", or_logic:"0" }, "dataFlags":8193, "totalItemsCount":1, "indexFrom":0, "indexTo":0, "items":[ { "nm":"sdk_account", "cls":3, "id":12345678, "mu":0, "rep":{ 1:{ "id":1, "n":"List of trips", "ct":"avl_unit", "c":59352 }, 2:{ "id":2, "n":"Grouped trips", "ct":"avl_unit", "c":6883 } }, "repmax":-1, "uacl":-1 } ] } ``` -------------------------------- ### Example request for update_billing_code Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_billing_code A concrete example of the request parameters for updating a unit's billing code. ```text svc=unit/update_billing_code¶ms={ "itemId": 1133, "code": "bf6364e80170cbd4a42bfa8eb446deff" } ``` -------------------------------- ### Parameter p Array of Objects Example Source: https://help.wialon.com/en/api/user-guide/api-reference/token/update Example of passing an array of objects as a string for the custom parameters parameter. ```json "p":"[{\"paramA\":\"valueB\"},{\"paramB\":\"valueD\"}]" ``` -------------------------------- ### update_video_autopay Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_video_autopay Example request for updating the automatic video payment settings for a list of unit IDs. ```text svc = unit/update_video_autopay¶ms = { "units": [5523461,1548776], "value": 10 } ``` -------------------------------- ### Multipart POST Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/upload_zone_image Example of a multipart/form-data POST request used to upload an image file to a geofence. ```http Request URL: https://hst-api.wialon.com/wialon/ajax.html?svc=resource/upload_zone_image Request Method: POST Host: hst-api.wialon.com Connection: keep-alive Content-Length: 31753 Cache-Control: no-cache Content-Type: multipart/form-data; boundary=----WebKitFormBoundaryX2W1y7AVnQkXQAM0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8 Accept-Charset: windows-1251,utf-8;q=0.7,*;q=0.3 Accept-Encoding: gzip,deflate,sdch Accept-Language: ru,en-US;q=0.8,en;q=0.6 ------WebKitFormBoundaryX2W1y7AVnQkXQAM0 Content-Disposition: form-data; name="params" {"itemId":717314,"id":1,"eventHash":"jUploadForm1372768029714"} ------WebKitFormBoundaryX2W1y7AVnQkXQAM0 Content-Disposition: form-data; name="eventHash" jUploadForm1372768029714 ------WebKitFormBoundaryX2W1y7AVnQkXQAM0 Content-Disposition: form-data; name="zone_create_upload_image"; filename="zZeVUgLEJXE.jpg" Content-Type: image/jpeg ------WebKitFormBoundaryX2W1y7AVnQkXQAM0-- ``` -------------------------------- ### Login Response Example Source: https://help.wialon.com/en/api/user-guide/code-examples/login-and-logout Example JSON response containing the session ID (eid) required for subsequent requests. ```JSON { "host": "212.98.173.107", "eid": "d1cb60897768780f846df7ab2400eb5f", "tm": 1358415984, "user": { "nm": "wialon_test", "cls": 1, "id": 50935, "prp": { "addr_provider": "map_visicom", "cfmt": "0", "city": "Mexico", "dst": "-1", "fpnl": "monitoring", "language": "ru", "show_log": "0", "tz": "134232128", "user_settings_hotkeys": "1", ... }, "token": "{\"app\":\"Wialon Hosting\",\"ct\":1443682655,\"at\":1443682655,\"dur\":2592000,\"fl\":-1,\"p\":\"{}\",\"items\":[]}", "th": "2fe8024e0ab91aa6c8ed82717b71bddcECDC362358DF7D90986F5173D405CD0D42DE7B38", "crt": 0, "bact": 50936, "fl": 6, "hm": "", "uacl": 2097795 }, "classes": { "avl_hw": 4, "avl_resource": 3, "avl_retranslator": 7, "avl_route": 6, "avl_unit": 2, "avl_unit_group": 5, "user": 1 }, "features": { "unlim": 1, "svcs": { ... } } } ``` -------------------------------- ### Success and Empty Response Examples Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/get_zones_by_unit Examples of successful responses containing data or an empty response when no units are found. ```json {"912":{"4":[917]}} ``` ```json { } ``` -------------------------------- ### Search items response example Source: https://help.wialon.com/en/api/user-guide/code-examples/item-search Example JSON response returned by the core/search_items method containing the search specification and the list of found items. ```json { "searchSpec": { "itemsType": "user", "propName": "sys_name", "propValueMask": "*", "sortType": "sys_name" }, "dataFlags": 1, "totalItemsCount": 1, "indexFrom": 0, "indexTo": 0, "items": [ { "nm": "test_6512789", "cls": 1, "id": 648548, "uacl": -1 } ] } ``` -------------------------------- ### Custom Event Interval Examples Source: https://help.wialon.com/en/api/user-guide/api-reference/events/get Examples of expression formats used in the expr parameter for custom event intervals. ```text trips{s>100} ``` ```text 1451953325-1451953525 ``` ```text (1615849200-1615935599|1615935601-1616022000) ``` ```text sensors[3] ``` -------------------------------- ### Assign Driver Request Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/bind_unit_driver Example request to assign a driver to a unit. ```text svc=resource/bind_unit_driver¶ms={"resourceId":930849,"driverId":2,"time":0,"unitId":24675341,"mode":1} ``` -------------------------------- ### Report Grouping Configuration Source: https://help.wialon.com/en/api/user-guide/api-reference/report/update_report Example of configuring report grouping using the 'p' parameter. ```json "p":"{ \"grouping\":\" {\"type\":\"total\",\"nested\": /* enable grouping \"Total\" */ {\"type\":\"year\"}}\" /* enable nested grouping \"Year\" */ }" ``` -------------------------------- ### Request with Password Source: https://help.wialon.com/en/api/user-guide/api-reference/account/check_smtp_settings Example request using explicit SMTP credentials for authentication. ```text svc=account/check_smtp_settings¶ms={ "send_from": "notifications@example.com", "send_to": "admin@example.com", "smtp_host": "smtps://smtp.gmail.com", "smtp_port": 465, "smtp_login": "notifications@example.com", "smtp_password": "your_app_password", "subject": "Test SMTP Connection", "body": "This is a test email to validate SMTP settings." } ``` -------------------------------- ### Assign Driver at Specific Time Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/bind_unit_driver Example request to assign a driver at a specific timestamp. ```text svc=resource/bind_unit_driver¶ms={"resourceId":930849, "driverId":17, "time":1644217620, "unitId":22361100, "mode":1} ``` -------------------------------- ### GUID Source: https://help.wialon.com/en/api/user-guide/data-format/resources Structure for the resource GUID. ```APIDOC ## GUID ### Description Represents the unique identifier for a resource. ### Structure - **gd** (text) - Resource GUID ``` -------------------------------- ### Get Action Parameters Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_hw_params Required parameters for the get action. ```json { "itemId":, "fullData": } ``` -------------------------------- ### Resource GUID Structure Source: https://help.wialon.com/en/api/user-guide/data-format/resources Represents the resource GUID with a flag value of 0x00000040. ```json { "gd": /* Resource GUID */ } ``` -------------------------------- ### Update retranslation property request example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_retranslation_property Example of the unit/update_retranslation_property request structure. ```text svc=unit/update_retranslation_property¶ms={"itemId":814743,"route_data":{"vehicle_type":"bus","route":"Somebody%20told%20me"}} ``` -------------------------------- ### Set session property example Source: https://help.wialon.com/en/api/user-guide/api-reference/core/set_session_property Example request to activate the skip_nonactive_items property. ```http svc=core/set_session_property¶ms={"prop_name": "skip_nonactive_items","prop_value": "1"} ``` -------------------------------- ### Create a resource via core/create_resource Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/creation-of-accounts-and-units Use this request to initialize a new resource. Ensure the creatorId and name parameters are correctly specified for your environment. ```http https://hst-api.wialon.com/wialon/ajax.html?svc=core/create_resource¶ms={"creatorId":22222,"name":"sdk_account","dataFlags":1,"skipCreatorCheck":0}&sid=SESSION_IDENTIFIER ``` -------------------------------- ### Example request for unit/get_deleted_reasons Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_delete_reasons A sample request demonstrating the usage of the endpoint with a specified language parameter. ```text svc=unit/get_deleted_reasons¶ms={"lang":"en"}&sid=fb1dcad80e79266044a3a5db5d9f68f3 ``` -------------------------------- ### Configure detect parameters Source: https://help.wialon.com/en/api/user-guide/api-reference/events/update_units Examples for configuring sensor detection settings within the update_units request. ```json "detect":{"*":0} ``` ```json "detect":{"ignition":0,"sensors":0} ``` ```json "detect":{"ignition,sensors":0} ``` ```json "detect":{"lls":2,"sensors":6} ``` -------------------------------- ### GUID JSON Structure Source: https://help.wialon.com/en/api/user-guide/data-format/retranslators Represents the GUID flag (0x00000040) for retrieving the retranslator's unique identifier. ```json { "gd": /* Retranslator GUID */ } ``` -------------------------------- ### Create an account via account/create_account Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/creation-of-accounts-and-units Use this request to create an account and associate it with an existing resource ID. The plan parameter defines the billing configuration for the new account. ```http https://hst-api.wialon.com/wialon/ajax.html?svc=account/create_account¶ms={"itemId":33333,"plan":"standard_client"}&sid=SESSION_IDENTIFIER ``` -------------------------------- ### Use icon from library Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_image Use this signature to apply an icon from a specific resource library. Pass 0 for libId to use the default library. ```text svc=unit/update_image¶ms={ "itemId": , "libId": , "path": } ``` -------------------------------- ### Request Syntax for get_video_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_video_settings The base request format for retrieving unit video settings. ```text svc=unit/get_video_settings¶ms={"itemId":long} ``` -------------------------------- ### file/get Source: https://help.wialon.com/en/api/user-guide/api-reference/file/get Retrieves a file from the system. ```APIDOC ## file/get ### Description Retrieves a file from the system. ### Endpoint file/get ``` -------------------------------- ### Example Report Result (JSON) Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/reports-execution This is an example of the JSON response structure when retrieving report result rows. ```JSON [ { "n":0, "i1":0, "i2":790, "t1":1688144420, "t2":1688154878, "d":0, "c":[ "1", { "t":"2023-06-30 20:00:20", "v":1688144420, "y":47.2941741943, "x":26.4906959534, "u":55555 }, { "t":"2023-06-30 22:54:38", "v":1688154878, "y":43.8697662354, "x":26.0177116394, "u":55555 }, "2:54:18", "469.54 km" ] }, { "n":1, "i1":936, "i2":2171, "t1":1688155181, "t2":1688169690, "d":0, "c":[ "2", { "t":"2023-06-30 22:59:41", "v":1688155181, "y":43.8698196411, "x":26.0177154541, "u":55555 }, { "t":"2023-07-01 03:01:30", "v":1688169690, "y":41.7139854431, "x":26.3660545349, "u":55555 }, "4:01:49", "343.84 km" ] }, { "n":2, "i1":2340, "i2":2486, "t1":1688170034, "t2":1688170841, "d":0, "c":[ "3", { "t":"2023-07-01 03:07:14", "v":1688170034, "y":41.7140579224, "x":26.365901947, "u":55555 }, { "t":"2023-05-01 09:23:10", "v":1688170841, "y":41.7122383118, "x":26.3712425232, "u":55555 }, "0:13:27", "1.39 km" ] }, { "n":3, "i1":2833, "i2":2910, "t1":1688171565, "t2":1688173175, "d":0, "c":[ "4", { "t":"2023-07-01 03:32:45", "v":1688171565, "y":41.7120819092, "x":26.3711204529, "u":55555 }, { "t":"2023-07-01 03:59:35", "v":1688173175, "y":41.5760040283, "x":26.9871864319, "u":55555 }, "0:26:50", "57.84 km" ] } ] ``` -------------------------------- ### Response URL with Access Token Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/basic-requests This is an example of the URL structure after a successful login, where the access token is provided as a URL parameter. ```url https://hosting.wialon.com/login.html?lang=en&user=USER_NAME&wialon_sdk_url=https%3A%2F%2Fhst%2Dapi%2Ewialon%2Ecom&access_token=TOKEN_VALUE&svc_error=0 ``` -------------------------------- ### Search users created after a specific date Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/basic-requests This example demonstrates how to retrieve a list of users created after a specific date and time, including their system IDs and email addresses. ```APIDOC ## GET https://hst-api.wialon.com/wialon/ajax.html ### Description Searches for users created after a specified date and time. The response includes system IDs and custom properties like email addresses. ### Method GET ### Endpoint https://hst-api.wialon.com/wialon/ajax.html ### Parameters #### Query Parameters - **svc** (string) - Required - The service to call, 'core/search_items'. - **params** (JSON string) - Required - A JSON string containing the search specifications. - **spec** (JSON object) - Required - Specifies the search criteria. - **itemsType** (string) - Required - Set to 'user' to search for users. - **propName** (string) - Required - Set to 'rel_creation_time' to filter by creation date. - **propValueMask** (string) - Required - The creation time in Unix timestamp format, preceded by a comparison operator (e.g., '>=1614058906'). - **sortType** (string) - Optional - The property to sort the results by (e.g., 'sys_name'). - **force** (integer) - Optional - If 1, previous search results are ignored. - **flags** (integer) - Optional - Bitmask to specify the data to include. '3' includes general properties (for system IDs) and custom properties (for email addresses). - **from** (integer) - Optional - The starting index for results (0 for no limit). - **to** (integer) - Optional - The ending index for results (0 for no limit). - **sid** (string) - Required - The Wialon session identifier. ### Request Example ``` https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"user","propName":"rel_creation_time","propValueMask":">=1614058906","sortType":"sys_name"},"force":1,"flags":3,"from":0,"to":0}&sid=SESSION_IDENTIFIER ``` ### Response #### Success Response (200) - **searchSpec** (JSON object) - The search specification used. - **dataFlags** (integer) - The flags used for the data retrieval. - **totalItemsCount** (integer) - The total number of items found. - **indexFrom** (integer) - The starting index of the returned items. - **indexTo** (integer) - The ending index of the returned items. - **items** (array) - An array of user objects matching the search criteria. Each object contains properties like 'id' (system ID) and custom properties which may include email addresses. #### Response Example (Response structure for users would be similar to the item search, with user-specific fields like 'id' and custom properties containing email addresses.) ```json { "searchSpec": { "itemsType": "user", "propName": "rel_creation_time", "propValueMask": ">=1614058906", "sortType": "sys_name" }, "dataFlags": 3, "totalItemsCount": 1, "indexFrom": 0, "indexTo": 0, "items": [ { "nm": "User Name", "cls": 1, "id": 1234567, "mu": 0, "custom_fields": { "email": "user@example.com" } } ] } ``` ``` -------------------------------- ### Batch Request for Driver Binding Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/bind_unit_driver Example of combining multiple bind_unit_driver requests into a single batch operation. ```text svc=core/batch¶ms={"params":[{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644217620,"unitId":22361100,"mode":true}},{"svc":"resource/bind_unit_driver","params":{"resourceId":930849,"driverId":17,"time":1644224880,"unitId":22361100,"mode":false}}],"flags":0} ``` -------------------------------- ### Search unit groups by multiple properties Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/basic-requests This example demonstrates how to find unit groups based on multiple criteria, such as the creator's name and the number of units within the group. ```APIDOC ## Search unit groups by multiple properties ### Description Retrieves a list of unit groups that meet specific criteria, such as being created by a particular user and containing a minimum number of units. ### Method GET ### Endpoint https://hst-api.wialon.com/wialon/ajax.html ### Query Parameters - **svc** (string) - Required - The service to call, which is 'core/search_items'. - **params** (JSON string) - Required - A JSON object containing search parameters: - **spec** (JSON object) - Required - Specifies the search criteria: - **itemsType** (string) - Required - The type of items to search for (e.g., 'avl_unit_group'). - **propName** (string) - Required - A comma-separated list of properties to filter on (e.g., 'rel_user_creator_name,rel_group_unit_count'). - **propValueMask** (string) - Required - The value mask for the properties. For creator name and unit count, it's a comma-separated string (e.g., 'User,>5'). - **sortType** (string) - Optional - The property to sort the results by (e.g., 'sys_name'). - **force** (integer) - Optional - If set to 1, previous search results are ignored. - **flags** (integer) - Optional - Bitmask to specify general properties, billing properties, and administrative fields to include in the response (e.g., 133). - **from** (integer) - Optional - The starting index for results (default 0). - **to** (integer) - Optional - The ending index for results (default 0, meaning no limit). - **sid** (string) - Required - The session identifier. ### Request Example ``` https://hst-api.wialon.com/wialon/ajax.html?svc=core/search_items¶ms={"spec":{"itemsType":"avl_unit_group","propName":"rel_user_creator_name,rel_group_unit_count","propValueMask":"User,>5","sortType":"sys_name"},"force":1,"flags":133,"from":0,"to":0}&sid=SESSION_IDENTIFIER ``` ### Response #### Success Response (200) Returns a JSON object containing a list of matching unit groups. ``` -------------------------------- ### Update Fleetio Tokens HTTP Request Example Source: https://help.wialon.com/en/api/user-guide/api-reference/item/update_fleetio_tokens A concrete example of an HTTP request to update Fleetio tokens. ```http https://hst-api.wialon.com/wialon/ajax.html?svc=item/update_fleetio_tokens¶ms={"itemId":912,"auth_token":"auth_token value","account_token":"account_token value"}&sid=f0c4b586ec1ebb4bc2694766effbc1b3 ``` -------------------------------- ### Create task Source: https://help.wialon.com/en/api/user-guide/api-reference/resource/get_notification_data JSON structure for creating a task with priority and assignee. ```JSON { "t": "create_task", /* action type */ "p": { "task_priority": "", /* task priority */ "task_assignee": "" /* ID of the user to whom the task is assigned */ } } ``` -------------------------------- ### Account Deletion Request Examples Source: https://help.wialon.com/en/api/user-guide/api-reference/account/delete_account Examples of API requests for deleting an account with units and an account with additional descriptive text for the deletion reason. ```text svc=account/delete_account¶ms={"itemId": 19812, "reasons": [{"reason_key": "delays_in_resolving_reported_technical_problems_partner"}]} ``` ```text svc=account/delete_account ¶ms={ "itemId": 19813, "reasons": [{ "reason_key": "missing_functionality_user", "text": "User needed a specific report that is not available."}]} ``` -------------------------------- ### Wialon API Search Items Response Example Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/basic-requests Example JSON response for a Wialon API search request, detailing found items, their properties, and associated sensors. ```json { "searchSpec": { "itemsType": "avl_unit", "propName": "sys_name", "propValueMask": "*Tractor*", "sortType": "sys_name", "propType": "", "or_logic": "0" }, "dataFlags": 4097, "totalItemsCount": 1, "indexFrom": 0, "indexTo": 0, "items": [ { "nm": "Tractor 1", "cls": 2, "id": 22353120, "mu": 0, "sens": { "1": { "id": 1, "n": "Ignition", "t": "engine operation", "d": "", "m": "On/Off", "p": "in1", "f": 0, "c": { "act": 1, "appear_in_popup": true, "ci": {}, "cm": 1, "mu": 0, "pos": 2, "show_time": false, "timeout": 0 }, "vt": 0, "vs": 0, "tbl": [] }, "2": { "id": 2, "n": "Fuel level", "t": "fuel level", "d": "", "m": "l", "p": "adc1", "f": 0, "c": { "act": 1, "appear_in_popup": true, "calc_fuel": 0, "ci": {}, "cm": 1, "fuel_params": { "fillingsJoinInterval": 300, "filterQuality": 0, "flags": 0, "ignoreStayTimeout": 10, "minFillingVolume": 20, "minTheftTimeout": 0, "minTheftVolume": 10, "theftsJoinInterval": 300 }, "mu": 0, "pos": 1, "show_time": false, "timeout": 0 }, "vt": 0, "vs": 0, "tbl": [] } }, "sens_max": -1, "uacl": -1 } ] } ``` -------------------------------- ### file/mkdir Source: https://help.wialon.com/en/api/user-guide/api-reference/file/mkdir Creates a new folder in the file storage. ```APIDOC ## file/mkdir ### Description Creates a new folder in the file storage. ### Parameters - **itemId** (long) - Required - Item ID - **storageType** (uint) - Required - Storage type: 1 (public), 2 (protected) - **path** (text) - Required - Relative path from the root folder to the folder you want to create. ### Request Example svc=file/mkdir¶ms={"itemId":, "storageType":, "path":} ### Response #### Success Response - Empty response {} ### Error Codes - 1: User not authorized. - 4: Invalid input parameters. - 5: Failed to create a folder at the specified path. - 7: Insufficient rights to the item specified in the itemId parameter. ``` -------------------------------- ### Report Select Result Rows Response Example Source: https://help.wialon.com/en/api/expert-articles/introduction-to-sdk/reports-execution This is an example of the JSON response structure when selecting result rows from a report. It includes nested data with details like timestamps, values, and coordinates. ```json [ { "n":0, "i1":0, "i2":1188, "t1":1688144420, "t2":1688158739, "d":1, "c":[ "1", "June", { "t":"20:00:20", "v":1688144420, "y":47.2941741943, "x":26.4906959534, "u":55555 }, { "t":"23:58:59", "v":1688158739, "y":43.1049079895, "x":25.6173667908, "u":55555 }, "3:53:36", "576.60 km" ], "r":[ { "n":0, "i1":0, "i2":1188, "t1":1688144420, "t2":1688158739, "d":2, "c":[ "1.1", "2023-06-30", { "t":"20:00:20", "v":1688144420, "y":47.2941741943, "x":26.4906959534, "u":55555 }, { "t":"23:58:59", "v":1688158739, "y":43.1049079895, "x":25.6173667908, "u":55555 }, "3:53:36", "576.60 km" ], "r":[ { "n":0, "i1":0, "i2":790, "t1":1688144420, "t2":1688154878, "d":0, "c":[ "1.1.1", "2023-06-30 20:00:20", { "t":"20:00:20", "v":1688144420, "y":47.2941741943, "x":26.4906959534, "u":55555 }, { "t":"22:54:38", "v":1688154878, "y":43.8697662354, "x":26.0177116394, "u":55555 }, "2:54:18", "469.54 km" ] }, { "n":1, "i1":936, "i2":1188, "t1":1688155181, "t2":1688158739, "d":0, "c":[ "1.1.2", "2023-06-30 22:59:41", { "t":"22:59:41", "v":1688155181, "y":43.8698196411, "x":26.0177154541, "u":55555 }, { "t":"23:58:59", "v":1688158739, "y":43.1049079895, "x":25.6173667908, "u":55555 }, "0:59:18", "107.06 km" ] } ] } ] }, { "n":1, "i1":1193, "i2":2910, "t1":1688158805, "t2":1688173175, "d":1, "c":[ "2", "July", { "t":"00:00:05", "v":1688158805, "y":43.0983314514, "x":25.6316585541, "u":55555 }, { "t":"03:59:35", "v":1688173175, "y":41.5760040283, ``` -------------------------------- ### update_video_autopay Response Example Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/update_video_autopay Successful response format showing unit IDs and their respective status codes. ```json [ {result:{5523461:{code:0}}}, {result:{1548776:{code:0}}} ] ``` -------------------------------- ### GET unit/get_speed_settings Source: https://help.wialon.com/en/api/user-guide/api-reference/unit/get_speed_settings Retrieves the speed parameters for a given unit. ```APIDOC ## GET unit/get_speed_settings ### Description Retrieves speed parameters for a specified unit. ### Endpoint svc=unit/get_speed_settings ### Parameters #### Query Parameters - **itemId** (long) - Required - The ID of the unit. ### Response #### Success Response (200) - **speedParameter** (string) - The speed parameter setting. - **speedMeasure** (int) - The speed measure unit. #### Response Example { "speedParameter": "speeds2", "speedMeasure": 1 } ### Error Codes - **4**: Wrong input parameter. - **7**: The user doesn’t have the required access right to the unit (ADF_ACL_ITEM_VIEW_PROPERTIES). ```