- branding_web - allow to use custom logos, color theme, domain and favicon in UI for web version
- branding_mobile - allow to use custom icon, logo, color theme in the mobile applications
- subpaas - allow to use Sub-Dealers (can be used only together with itrack_label)
- itrack_label - show "Powered by iTrack" in UI (required for subpaas feature)
errors:
- 12 - Dealer not found (if corresponding PaaS was not found in database)
- 201 - Not found in database (if there is no Ui settings data for corresponding PaaS)
delivery/
read(...)
Returns info sufficient for tracking certain task state and the tracker assigned to it. Search is conducted only among tasks and checkpoints, which have start date less than or equal now and have statuses: arrived, assigned or delayed. If multiple tasks or checkpoints were found, then return first task, otherwise checkpoint.
session types:
in addition to standard user session, this call supports special DELIVERY session type
parameters:
- external_id - an external id of task. Non-null, non-empty string.
return:
{
"success": true,
"user_id": 3, // master id of the user to which the task belongs to
"task" : ${task}, //a task object, for more info see task/ section
"tracker" : ${tracker}, //corresponding tracker object, for more info see tracker/ section
"restrictions": ${restrictions}, //tariff restrictions object, for more info see user/get_tariff_restrictions
"first_name": "John", //first name of employee assigned to the task, or null if missing
"middle_name": "Micheel", //middle name of employee assigned to the task, or null if missing
"last_name": "Johnson", //last name of employee assigned to the task, or null if missing
"vehicle_label": "Service car 002", //label of the vehicle assigned to the task, or null if missing
"estimated_time": 1122 //estimated time of arrival in seconds, or null if unavailable
}
errors:
- 201 - Not found in database (when there is no task or checkpoint with specified conditions)
list(...)
Returns info sufficient for tracking certain task state and the tracker assigned to it. Search is conducted only among tasks and checkpoints, which have start date less than or equal now and have statuses: arrived, assigned or delayed.
session types:
in addition to standard user session, this call supports special DELIVERY session type
parameters:
- external_id - an external id of task. Non-null, non-empty string.
return:
{
"success": true,
"list": [{
"task" : ${task}, //a task object, for more info see task/ section
"tracker" : ${tracker}, //corresponding tracker object, for more info see tracker/ section
"first_name": "John", //first name of employee assigned to the task, or null if missing
"middle_name": "Micheel", //middle name of employee assigned to the task, or null if missing
"last_name": "Johnson", //last name of employee assigned to the task, or null if missing
"vehicle_label": "Service car 002", //label of the vehicle assigned to the task, or null if missing
"estimated_time": 1122 //estimated time of arrival in seconds, or null if unavailable
}],
"user_id": 3, // master id of the user to which the tasks belongs to
"restrictions": ${restrictions}, //tariff restrictions object, for more info see user/get_tariff_restrictions
}
errors:
- 201 - Not found in database (when there is no task or checkpoint with specified conditions)
department/
<department> =
{
"id": 222,
"label": "Drivers",
"location": { //optional, location associated with this departments. should be valid or null
"lat": 46.9,
"lng": 7.4,
"address": "Rosenweg 3", //address of the location
"radius": 150 //radius of location zone in meters
},
}
list(...)
Get all departments belonging to user.
return:
{
"success": true,
"list": [ , ... ]
}
create(...)
Create new department.
required subuser rights: employee_update
parameters:
- department - an department object Non-null.
return:
{
"success": true,
"id": 111 //id of the created department
}
update(...)
Update existing department.
required subuser rights: employee_update
parameters:
- department - an department object Non-null.
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no department with such id)
delete(...)
Delete department with the specified id.
required subuser rights: employee_update
parameters:
- department_id - Id of the department, int.
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no department with such id)
employee/actions:
employee is:
{
"id": 222,//
"tracker_id": null, //
"first_name": "John", //
"middle_name": "Jane", //
"last_name": "Smith", //
"email": "smith@example.com", //
"phone": "+442071111111", //
"driver_license_number": "SKIMP407952HJ9GK 06", //
"driver_license_cats": "C", //
"driver_license_valid_till": "2018-01-01", //
"hardware_key": null,//
"icon_id" : 55, // int, can be null, can only be updated via avatar/assign(...)
"avatar_file_name": null,//,
"department_id": null, //,
"location": { //optional, location associated with this employee, shoul be valid or null
"lat": 52.5,
"lng": 13.4,
"address": "Engeldamm 18" //address of the location
},
"personnel_number": "1059236", // optional, string, max lenght is 15
"tags": [1,2] //array of tag ids
}
list(...)
Get all employees belonging to user.
return:
{
"success": true,
"list": [ , ... ]
}
create(...)
Create new employee.
required subuser rights: employee_update
parameters:
- employee - an employee object Non-null.
return:
{
"success": true,
"id": 111 //id of the created employee
}
errors:
- 247 - Entity already exists, if tracker_id!=null and exists employee that already binded to this tracker_id
read(...)
Get employee by id.
parameters:
- employee_id - Id of the employee, int.
return:
{
"success": true,
"value":
}
errors:
- 201 - Not found in database (if there is no employee with such id)
update(...)
Update existing employee.
required subuser rights: employee_update
parameters:
- employee - an employee object Non-null.
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no employee with such id)
- 247 - Entity already exists, if tracker_id!=null and exists employee that already binded to this tracker_id
delete(...)
Delete employee with the specified id.
required subuser rights: employee_update
parameters:
- employee_id - Id of the employee, int.
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no employee with such id)
feedback/ actions:
<feedback> = {
"text": ,
"useragent": ,
"platform": ,
"screenshots": <optional, array of strings, base64-encoded data:url image, example: data:image/jpeg;base64,[encoded image]>,
"log":
}
send_email(...)
Get all employees belonging to user.
parameters:
Send email with feedback message on feedback.toEmail Where type is one of strings: support_request(default), feature_request and review.
Screenshot and log will be added to email as attachments.
return:
{
"success": true
}
file/
stats/read
Get user's files statistic..
return:
{
"success": true,
"value": {
"file_count": 24, // count of all updloaded files
"total_size": 40192953 // total files size in bytes
"quota": 104857600 // space available to the user in bytes
}
}
form/
Forms are used to provide additional information, such as user name, phone, delivery date, etc. upon task completion. Forms are attached to tasks. If form is attached to task, this task cannot be complete without form submission.
garage/ actions:
<garage> =
{
"id": 222,
"location": { //valid location or null
"lat": 40.4,
"lng": -3.6,
"address": "Calle Salitre, 58",
"radius": 150
},
"mechanic_name": "Martinez",
"dispatcher_name": "Velasquez",
"organization_name": "Bankia"
}
list(...)
Get all garages belonging to user.
return:
{
"success": true,
"list": [ , ... ]
}
create(...)
Create new garage.
required subuser rights: vehicle_update
parameters:
- garage - an garage object Non-null.
return:
{
"success": true,
"id": 111 //id of the created garage
}
update(...)
Update existing garage.
required subuser rights: vehicle_update
parameters:
- garage - an garage object Non-null.
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no garage with such id)
delete(...)
Delete garage with the specified id.
required subuser rights: vehicle_update
parameters:
- name
- description
- type
- namegarage_id
- descriptionId of the garage to delete
- typeint
return:
{
"success": true
}
errors:
- 201 - Not found in database (if there is no garage with such id)
geocoder/ actions:
Geocoders:
- google
- yandex
- progorod
- osm
- locationiq
details_object is:
{
"country": , // optional
"province": , // optional
"locality": , // optional
"street": , // optional
"house": , // optional
"postcode": // optional
}
search_address(...)
Performs a forward geocoding. Returns a list of locations matching the given address. Items in the list are sorted by relevance.
parameters:
- q - address (or place) or coordinates (comma separated decimal degrees e.g. 60.0,-61.0) to geocode
- lang - language in which results should be. E.g. "en"
- geocoder - geocoder type
- bounds - optional, JSON object. The bounding box, specified by coordinates of northwest and southeast corners. Geocoder will preferably return results from within these bounds. That is the parameter influences the priority of results, so if more relevant results exist outside of bounds, they may be included.
- lang - optional, string, ISO 639 language code
- with_details - optional, boolean. If true then the response will contain details
bounds={"nw":{"lat":60.0,"lng":61.0},"se":{"lat":55.0,"lng":60.0}}
return:
{
"success": true,
"locations": [
{
"lat": <lat>, // double
"lng": <lng>, // double
"address": <address>, // string
"details": <details_object> // optional
},
...
]
}
search_location(...)
parameters:
- location - not null, location (see: custom types section)
- geocoder - optional, string (enum). Now supported google, osm, yandex, locationiq geocoders.
- lang - optional, string, ISO 639 language code
- with_details - optional, boolean. If true then the response will contain details
- goal - optional, string (enum). Now supported ui, ui_user_action. Helps to choose the target geocoder. Use ui_user_action for requests initiated by user, otherwise ui.
Search address by location. User language wil be used If lang is omitted.
return:
{
"success": true,
"value": <address>, // string
"details": <details_object> // optional
}
history/ entries
history entry is one of:
- common_history_entry
{
"id": ,
"type": "common",
"is_read": ,
"message": ,
"time": ,
"event": // type of history event
}
- tracker_history_entry
{
"id": ,
"type": "tracker"
"is_read": ,
"message": ,
"time": ,
"event": , // type of history event
// extension
"tracker_id": , // column object_id
"rule_id": , // column event_id
"track_id": ,
"location":{
"lat": ,
"lng": ,
"precision":
},
"address": "address", // string. address of location or "" (empty string)
"extra": {
"task_id": , //related task identifier
"parent_task_id": , //related parent task identifier (for task checkpoint related history entries)
"counter_id": , //related counter identifier
"service_task_id": , //related service task id
"checkin_id": , //related check-in marker
"place_ids": , //related place identifiers,
"last_known_location": , //true if location may be outdated,
"tracker_label": ,//tracker label
"emergency": ${boolean} //true for events with a same flag, optional
}
}
- Depricated event types
- camera_history_entry
{ "id": , "type": "camera" "is_read": , "message": , "time": , "event": , // type of history event // extension "camera_id": , "pack_id": // photos pack id }
- socket_history_entry
{ "id": , "type": "camera" "is_read": , "message": , "time": , "event": , // type of history event // extension "socket_id": }
Date/time type described in custom types description.
read(...)
Returns history entry with the specified id.
parameters:
- id - int. history entry ID
- add_tracker_label - boolean. optional, if true tracker label will be added to message
return:
{
"success": true,
"value": ${history_entry}
}
where tracker_history_entry described in History entries
errors:
- 201 - Not found in database (when there are no history entries with that id)
mark_read(...)
Mark history entry as read by id (see: History entries).
parameters:
- id - int. history entry ID
return:
{ "success": true }
errors:
- 201 - Not found in database (when there are no history entries with that id)
mark_read_all()
Mark all user’s history entries read..
return:
{ "success": true }
tracker/
list(...)
List less then or equal to limit of tracker events filtered by event types (events) between from date/time and to date/time sorted by time field.
parameters:
- trackers - [int]. list of tracker's ids
- from - date/time. start date/time for searching
- to - date/time. end date/time for searching. must be after "from" date
- events - ["string"] (optional, default: all). list of history types
- limit - int (optional, default: maxHistoryLimit). max count of entries in result
- ascending - boolean (optional, default: true). Sort ascending by time when it is true and descending when false.
If events (event types) not passed then list all event types.
Available event types: alarmcontrol, battery_off, bracelet_close, bracelet_open, crash_alarm, detach, door_alarm, driver_changed, force_location_request, g_sensor, gps_lost, gps_recover, gsm_damp, harsh_driving, hood_alarm, idle_end, idle_start, ignition, info, input_change, inroute, outroute, inzone, outzone, lowpower, obd_plug_in, obd_unplug, obj_control, offline, online, parking, poweroff, poweron, security_control, sos, speedup, track_end, track_start, sensor_inrange, sensor_outrange, strap_bolt_cut, strap_bolt_ins, vibration_start, vibration_end, light_sensor_bright, light_sensor_dark
Default and max limit is 100 by default. (Note for StandAlone: this value configured by maxHistoryLimit config option).
example:
http://api.navixy.com/v2/history/tracker/list?hash=user_hash&trackers=[tracker_id]&from=2018-02-19 10
return:
{
"success": true,
"list": [ ${tracker_history_entry}, ... ], // list of zero or more JSON objects
"limit_exceeded": false // boolean. false when listed all history entries satisfied to conditions
// and true otherwise
}
where tracker_history_entry described in History entries
errors:
- 211 - Requested time span is too big (time span between from and to is more than maxReportTimeSpan days)
- 212 - Requested limit is too big (limit is more than maxHistoryLimit)
- 217 - List contains nonexistent entities - if one of the specified trackers does not exist or is blocked
type/
list(...)
Returns available history types with localized descriptions.
parameters:
- locale - locale code
- only_tracker_events - boolean (optional). Default - true.
return:
{
"success": true,
"list": [, ...]
}
where history_type is
{
"type": , // history type, e.g. "alarmcontrol"
"description": // localized description, e.g. "Car alarm"
}
unread/
list(...)
List less then or equal to limit of latest user's unread history entries with optional type (tracker|camera|socket).
parameters:
- limit, int, optional
- from, date/time, optional
- type, string one of tracker,camera,socket, optional
Default and max limit is maxHistoryLimit.
Type of from is date/time. Default from is now minus one year.
return:
{
"success": true,
"list": [${history_entry}, ... ] //list of zero or more JSON objects
}
where history_entry described in History entries
errors:
- 212 - Requested limit is too big (more maxHistoryLimit config option)
count/
Get count of user's unread history messages from from date with optional type (tracker|camera|socket).
parameters:
- from - optional
- type - optional
Type of from is date/time. Default from is now minus one year.
return:
{
"success": true,
"count": // int
}
map_layer
map_layer_object is:
{
"id": , // map layer entity ID
"label": // map layer name, e.g. "test"
}
read(...)
Read the body of the specified layer.
parameters:
name | description | type |
id | ID of the map layer | int |
return:
Layer body with content-type: application/vnd.google-earth.kml+xml; charset=utf-8
errors:
- 201 (Not found in database) - if there is no map layer with such ID belonging to current user
list(...)
Returns metadata for all map layers for the user.
return:
{
"success": true,
"list": [<map_layer_object>, ... ]
}
upload()
Uploads new map layer.
MUST be a POST multipart request (multipart/form-data), with one of the parts being a KML file upload (with the name "file").
parameters:
name | description | type |
label | Label for a new map layer | string |
file | A KML file upload containing map_layer data | File upload |
redirect_target | (optional) URL to redirect. If redirect_target passed return redirect to ?response= | string |
return:
{
"success": true,
"id": 163 // int. ID of the created layer
}
errors:
- 233 (No data file - if file part is missing
- 234 (Invalid data format - if file has wrong mime type
- 242 (Validation error - if uploaded file is not valid KML
- 268 (Over quota - if the user's quota for map layers is exceeded
update(...)
Update metadata for the specified map layer.
parameters:
name | description | type |
layer | | JSON object |
return:
{ "success": true }
errors:
- 201 (Not found in database) - if there is no map layer with such ID belonging to current user
delete(...)
Delete specified layer.
parameters:
name | description | type |
id | ID of the map layer | int |
return:
{ "success": true }
errors:
- 201 (Not found in database) - if there is no map layer with such ID belonging to current user
notification/
list()
List user notifications.
return:
{
"success": true,
"list": [, ...]
}
where
<notification> =
{
"id": <int>,
"message": <string>,
"show_till": <date/time> // date until notification should be showed, e.g. "2014-08-03 17:27:28"
}
payment_system/
list()
Return list of payment systems available for user.
required subuser rights: payment_create
return:
{
"success": true,
"list": [
, ...]
}
where payment_system_settings is:
{
"type": "rbkmoney", // payment system type
"url": "https:_rbkmoney.com
/acceptpurchase.aspx", // URL to send payment info,
"account": , // (optional) dealer account in payment system (eshopId for RBK)
"currency": "EUR", // 3-letter ISO 4217 currency code
"payment_code": "iTrack Demo", // (optional) code for payments
"subscription_code": "4671292", // (string) subscription code. same as "payment_code" for 2Checkout (formerly Avangate) but for subscriptions
"methods": [, ...] // (optional) list of available payment methods (may be empty)
// for type == "ios_inapp" only:
"prices": {
"Loccate_default_pay_1": 0.99,
"Loccate_default_pay_5": 4.99,
"Loccate_default_pay_10": 9.99,
"Loccate_default_pay_20": 19.99
}
}
errors:
- 201 - Not found in database.
place actions
place is:
{
"id": 1, // int
"icon_id" : 55, // int, optional, [1..255], can only be updated via avatar/assign()
"avatar_file_name": null, // string, optional
"location": {
"lat": 52.366,
"lng": 4.895,
"address": "Halvemaansteeg, 3, Amsterdam, North Holland, Netherlands, 1017 CR",
"radius": 500
},
"label": "Baba",
"description": "Best place at http://itrack.live", // string, optional
"tags": [ 1, 2 ], // list of ints, optional, non-empty
"external_id": "1" // string, optional, max length 32
}
read (...)
Get place by ID.
parameters:
name | description | type |
place_id | ID of the place | int |
return:
{
"success": true,
"value": <place>
}
errors:
- 201 (Not found in database) - if there is no place with such ID
list (...)
Get places belonging to user.
parameters:
name | description | type |
place_ids | optional, list of place IDs | array of ints |
tag_ids | optional, list of tag IDs | array of ints |
filter | optional, filter for label, description | string |
ascending | optional, if false - descending order | boolean |
limit | optional, limit | int |
offset | optional, offset, default is 0 | int |
return:
{
"success": true,
"list": [ <place>, ... ],
"count": 1 // found places count
}
create (...)
Create new place.
required subuser rights: place_update
parameters:
name | description | type |
place | <place> | JSON object |
return:
{
"success": true,
"id": 111 // ID of the created place
}
errors:
- 268 (Over quota) - if the user's quota for places is exceeded
update (...)
Update existing place.
required subuser rights: place_update
parameters:
name | description | type |
place | <place> | JSON object |
return:
{ "success": true }
errors:
- 201 (Not found in database) - if there is no place with such ID
delete (...)
Delete place with the specified ID.
required subuser rights: place_update
parameters:
name | description | type |
place_id | ID of the place to delete | int |
return:
{ "success": true }
errors:
- 201 (Not found in database) - if there is no place with such ID
plugin/
Plugins are special software modules which modify the behavior of various API calls. For more information, see about plugins.
Plugin object structure
<plugin> =
{
"id":
, //int
"type": , //String
"ui_module": , //String
"module": , //String
"filter": { //a model filter which describes to which device models this plugin is applicable
"exclusion": true, //if true, "models" lists models NOT supported by this plugin, if false, "models" contains all supported models
"values": //string[]
},
"parameters" : { ... } //Plugin-specific parameters as JSON object. This field is omitted if it's null (and it is null most of the time)
}
Example
{
"id": 4,
"type": "tracker_report",
"module": "com.itrack.plugin.tracker
.report.trip",
"ui_module": "Trip",
"filter": {
"exclusion": true,
"values": []
}
}
list (...)
Get all plugins available to the user. List of available plugins may vary from user to user depending on platform settings and purchased features. Only these plugins can be used to register trackers, generate reports, etc.
return:
{
"success": true,
"list": [ <plugin>, ... ]
}
retranslator/
CRUD actions for retranslators.
objects
retranslator_protocol is:
{
"id": , // protocol ID
"name": , // protocol name
"has_login": , // true if this protocol use login
"has_password": , // true if this protocol use password
"fake_device_id_pattern": <string> // regex pattern for fake_device_id validation, optional
}
retranslator is:
{
"id": <int>, // retranslator ID, e.g. 1
"name": <string>, // zone label, e.g. "Some Wialon server"
"protocol_id": <int>, // protocol ID
"address": <string>, // network address, e.g. "127.0.0.1 or localhost"
"port": <int>, // port, e.g. 15000
"login": <string>, // optional
"password": <string>, // optional
"enabled": <boolean> // status
}
create (...)
Create new retranslator.
required subuser rights: admin (available only to master users)
parameters:
name | description | type |
retranslator | without "id" field | |
return:
{
"success": true,
"id": <int> // ID of the created retranslator
}
errors:
- 247 (Entity already exists) - if retranslator with this address, port and login already exists
- 268 (Over quota) - if the user's quota for retranslators is exceeded
delete (...)
Delete user's retranslator with ID = retranslator_id.
required subuser rights: admin (available only to master users)
parameters:
return:
{ "success": true }
errors:
- 201 (Not found in database).
list (...)
Get all user's retranslators
return:
{
"success": true,
"list": [ , ... ]
}
route/
get (...)
Get route points via specified route provider.
parameters:
- start - (location JSON object) start of route
- end - (location JSON object) end of route
- waypoints = [ ${location}, ... ] - (optional) list of transitional points.
- point_limit - (optional. int. min=2) If specified, the returned route will be simplified to contain this number of points (or less).
- provider_type - (optional, string, one of progorod|google|osrm) If not specified, the default user provider is used.
Where location described in custom types description section.
return:
{
"success": true,
"distance": 2546, // (int) length in meters
"time": 194, // (int) duration in seconds
"list": [ ${location}, ... ], // list of route points
"key_points": [ ${key_point}, ... ]
}
key_points is list of points corresponding to start point, waypoints and end point (in that sequence). Where key_point is JSON object:
{
"id": 123, // (int) index in points 'list'
"lat": 56.827, // latitude
"lng": 60.594296 // longitude
}
errors:
- 215 (External service error)
- 218 (Malformed external service parameters)
- 236 (Feature unavailable due to tariff restrictions) - if there is at least one tracker without "routing" tariff feature
track/
Contains API calls to interact with tracks and for getting tracks' points.
API actions
API path: /track.
download
Downloads track points as KML/KMZ file for the specified track ID, tracker and time period.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 123456 |
from | From date/time. | date/time | "2020-09-23 03:24:00" |
to | To date/time. Specified date must be after "from" date. | date/time | "2020-09-23 06:24:00" |
track_ids | Optional. If specified, only points belonging to the specified tracks will be returned. If not, any valid track points between "from" and "to" will be returned. | int array | [123456, 234567] |
include_gsm_lbs | Optional. If false && track_ids not specified, GSM LBS points will be filtered out. Default=true. | boolean | true |
simplify | Optional. If true the returned track will be simplified. Default=true. | boolean | true |
point_limit | Optional. If specified and simplify=true, the returned track will be simplified to contain this number of points. Min=2, Max=3000. If not specified, the server settings to decimates track will be used. It is not a hard limit, returned track may contain more points. | int | 300 |
filter | Optional. If specified, the returned track will be filtered, applicable only for LBS tracks now. | boolean | true |
format | File format, "kml" or "kmz", default is "kml". | enum | "kml" |
split | If true, split tracks by folders with start/end placemarks and track line. Default=false. | boolean | false |
Example:
curl -X POST 'https://api.itrack.live/track/download' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tracker_id": 123456, "from": "2020-09-23 03:24:00", "to": "2020-09-23 06:24:00", "format": "kml", "split": false}'
response
{
"success": true,
"list": [],
"limit_exceeded": true
}
errors:
- 204 - Entity not found - if there is no tracker with such ID belonging to authorized user.
- 208 - Device blocked - if tracker exists but was blocked due to tariff restrictions or some other reason.
- 211 - Requested time span is too big - if interval between "from" and "to" is too big (maximum value specified in API config).
list
Gets a list of track descriptions for the specified tracker and time period.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 123456 |
from | From date/time. | date/time | "2020-09-23 03:24:00" |
to | To date/time. Specified date must be after "from" date. | date/time | "2020-09-23 06:24:00" |
filter | Optional, default=true. If true, tracks which are too short (in terms of length and number of points) will be omitted from resulting list. | boolean | true |
split | Optional, default=true. If false, all tracks will be merged into single one. | boolean | true |
include_gsm_lbs | Optional, default=true. If false, GSM LBS tracks will be filtered out. | boolean | true |
cluster_single_reports | Optional, default=false. If true, single point reports will be clustered by its coordinates. | boolean | false |
count_events | Optional, default=false. If true, number of events occurred during each non-single point track will be returned. | boolean | false |
Example:
curl -X POST 'https://api.itrack.live/track/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tracker_id": 123456, "from": "2020-09-23 03:24:00", "to": "2020-09-23 06:24:00"}'
response
{
"success": true,
"limit_exceeded": false,
"list": []
}
- limit_exceeded - boolean. true if the requested time period exceeds limit specified in a tracker's tariff.
- list - array of JSON objects. List of zero or more JSON objects.
where is either , , or :
regular object:
{
"id": 123456,
"start_date": "2020-09-23 03:39:44",
"start_address": "1255 6th Ave, New York, NY 10020, USA",
"max_speed": 62,
"end_date": "2020-09-23 06:39:44",
"end_address": "888 5th Ave, New York, NY 10021, USA",
"length": 5.5,
"points": 327,
"avg_speed": 49,
"event_count": 3,
"norm_fuel_consumed": 1.07,
"type": "regular",
"gsm_lbs": false
}
- id - int. Track id.
- start_date - date/time. Track start date, in user's timezone e.g. "2011-06-18 03:39:44".
- start_address - string. Track start address.
- max_speed - int. Maximum speed in km/h, e.g. 96.
- end_date - date/time. Track end date, in user's timezone e.g. "2011-06-18 05:18:36".
- end_address - string. Track end address.
- length - float. Track length in kilometers, e.g. 85.5.
- points - int. Total number of points in a track, e.g. 724.
- avg_speed - int. Average speed in km/h, e.g. 70.
- event_count - int. Number of events on this track. Field will be omitted if "count_events" is false.
- norm_fuel_consumed - float. A consumed fuel on track, litres. Field will be omitted if no vehicle bound to tracker or no normAvgFuelConsumption defined in a vehicle.
- type - enum: regular, single_report, merged, cluster. Used to distinguish this track type (regular) from the others.
- gsm_lbs - optional boolean. GSM LBS point flag.
single_report object. Returned if device was creating reports in "interval" mode (e.g. M7 tracker in interval mode):
{
"id": 123456,
"start_date": "2020-09-24 03:39:44",
"start_address": "1255 6th Ave, New York, NY 10020, USA",
"avg_speed": 34,
"gsm_lbs": false,
"type": "single_report",
"precision": 10
}
- id - int. Track id.
- start_date - date/time. Track start date, in user's timezone e.g. "2011-06-18 03:39:44".
- start_address - string. Point address.
- avg_speed - int. Average speed in km/h, e.g. 70.
- gsm_lbs - optional boolean. GSM LBS point flag.
- type - enum: regular, single_report, merged, cluster. Used to distinguish this track type (single_report) from the others.
- precision - optional int. Location precision, meters.
merged object. Only returned if "split" is set to false:
{
"start_date": "2020-09-24 03:39:44",
"start_address": "1255 6th Ave, New York, NY 10020, USA",
"max_speed": 62,
"end_date": "2020-09-24 06:39:44",
"end_address": "888 5th Ave, New York, NY 10021, USA",
"length": 5.5,
"points": 327,
"avg_speed": 49,
"event_count": 3,
"norm_fuel_consumed": 1.07,
"type": "merged",
"gsm_lbs": false
}
- start_date - date/time. Track start date, in user's timezone e.g. "2011-06-18 03:39:44".
- start_address - string. Track start address.
- max_speed - int. Maximum speed in km/h, e.g. 96.
- end_date - date/time. Track end date, in user's timezone e.g. "2011-06-18 05:18:36".
- end_address - string. Track end address.
- length - float. Track length in kilometers, e.g. 85.5.
- points - int. Total number of points in a track, e.g. 724.
- avg_speed - int. Average speed in km/h, e.g. 70.
- event_count - int. Number of events on this track. Field will be omitted if "count_events" is false.
- norm_fuel_consumed - float. A consumed fuel on track, litres. Field will be omitted if no vehicle bound to tracker or no normAvgFuelConsumption defined in a vehicle.
- type - enum: regular, single_report, merged, cluster. Used to distinguish this track type (merged) from the others.
- gsm_lbs - optional boolean. GSM LBS flag.
cluster object. Only returned if "split" is set to true:
{
"start_date": "2020-09-24 03:39:44",
"start_address": "1255 6th Ave, New York, NY 10020, USA",
"end_date": "2020-09-24 06:39:44",
"precision": 500,
"points": [{"lat": 56.829274,"lng": 60.597125}, {"lat": 56.829279,"lng": 60.597123}],
"type": "cluster",
"gsm_lbs": false
}
- start_date - date/time. Track start date, in user's timezone e.g. "2011-06-18 03:39:44".
- start_address - string. Track start address.
- end_date - date/time. Track end date, in user's timezone e.g. "2011-06-18 05:18:36".
- precision - optional int. Location precision, meters.
- points - array of points in a cluster.
- type - enum: regular, single_report, merged, cluster. Used to distinguish this track type (cluster) from the others.
- gsm_lbs - optional boolean. GSM LBS flag, true if cluster contains only GSM LBS points.
errors:
- 204 - Entity not found - if there is no tracker with such ID belonging to authorized user.
- 208 - Device blocked - if tracker exists but was blocked due to tariff restrictions or some other reason.
- 211 - Requested time span is too big - if interval between "from" and "to" is too big (maximum value specified in API config).
read
Gets track points for the specified track ID, tracker and time period.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 123456 |
from | From date/time. | date/time | "2020-09-23 03:24:00" |
to | To date/time. Specified date must be after "from" date. | date/time | "2020-09-23 06:24:00" |
track_id | Optional. If specified, only points belonging to the specified track will be returned. If not, any valid track points between "from" and "to" will be returned. | int | 234567 |
include_gsm_lbs | Optional, default=true. If false && track_id not specified, GSM LBS points will be filtered out. | boolean | true |
simplify | Optional. If true the returned track will be simplified. Default=true. | boolean | true |
point_limit | Optional. If specified and simplify=true, the returned track will be simplified to contain this number of points. Min=2, Max=3000. If not specified, the server settings to decimates track will be used. It is not a hard limit, returned track may contain more points. | int | 300 |
filter | Optional. If specified, the returned track will be filtered, applicable only for LBS tracks now. If false a response will contain parking points. | boolean | false |
Example:
curl -X POST 'https://api.itrack.live/track/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tracker_id": 123456, "from": "2020-09-23 03:24:00", "to": "2020-09-23 06:24:00"}'
response
{
"success": true,
"limit_exceeded": true,
"list": [
{
"lat": 53.445181,
"lng": -2.276432,
"alt": 10,
"satellites": 8,
"get_time": "2011-06-18 03:39:44",
"address": "4B Albany Road, Manchester, Great Britain",
"heading": 298,
"speed": 70,
"precision": 100,
"gsm_lbs": true,
"parking": true,
"buffered": true
}
}
- limit_exceeded - boolean. true if requested time period exceeds limit specified in a tracker's tariff.
- lat - float. Latitude.
- lng - float. Longitude.
- alt - int. Altitude in meters.
- satellites - int. Number of satellites used in fix for this point.
- get_time - date/time. GPS timestamp of the point, in user's timezone.
- address - string. Point address. Will be "" if no address recorded.
- heading - int. Bearing in degrees (0..360).
- speed - int. Speed in km/h.
- precision - optional int. Precision in meters.
- gsm_lbs - optional boolean. true if location detected by GSM LBS.
- parking - optional boolean. true if point does not belong to track.
- buffered - optional boolean. true if point was saved in device memory and transferred to server later.
errors:
- 204 - Entity not found - if there is no tracker with such ID belonging to authorized user.
- 208 - Device blocked - if tracker exists but was blocked due to tariff restrictions or some other reason.
- 211 - Requested time span is too big - if interval between "from" and "to" is too big (maximum value specified in API config).
tracker/
This document contains tracker object structure and API calls to interact with it. Tracker is one of the key entities in our API. It represents tracking device registered in our GPS monitoring system. Lots of API calls created for manipulation of tracker and/or its properties.
TRACKER OBJECT STRUCTURE
{
"id": 123456,
"label": "tracker label",
"clone": false,
"group_id": 167,
"avatar_file_name" : "file name",
"source": {
"id": 234567,
"device_id": 9999999988888,
"model": "telfmb920",
"blocked": false,
"tariff_id": 345678,
"status_listing_id": null,
"creation_date": "2011-09-21",
"tariff_end_date": "2016-03-24",
"phone": "71234567890"
}
"tag_bindings": [
{
"tag_id": 456789,
"ordinal": 4
}]
}
- id - int. Tracker id aka object_id.
- label - string. Tracker label.
- clone - boolean. true if this tracker is clone.
- group_id - int. Tracker group id, 0 when no group.
- avatar_file_name - string. Optional. Passed only if present.
- source - object.
- id - int. Source id.
- device_id - string. Device id aka source_imei.
- model - string. Tracker model name from "models" table.
- blocked - boolean. true if tracker blocked due to tariff end.
- tariff_id - int. An id of tracker tariff from "main_tariffs" table.
- status_listing_id - int. An id of the status listing associated with this tracker, or null.
- creation_date - date/time. Date when the tracker registered.
- tariff_end_date - date/time. Date of next tariff prolongation, or null.
- phone - string. Phone of the device. Can be null or empty if device has no GSM module or uses bundled SIM which number hidden from the user.
- tag_binding - object. List of attached tags. Appears only for tracker/list call.
- tag_id - int. An id of tag. Must be unique for a tracker.
- ordinal - int. Number that can be used as ordinal or kind of tag. Must be unique for a tracker. Max value is 5.
API actions
API path: /tracker.
read
Gets tracker info by ID.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). | int | 999199 |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "tracker_id": 123456}'
'HTTP GET'
https://api.itrack.live/tracker/read?hash=a6aa75587e5c59c32d347da438505fc3&tracker_id=123456
response
{
"success": true,
"value": {,
"id": 123456,
"label": "Object 1",
"group_id": 0,
"source": {
"id": 10021901,
"device_id": "123456789009876",
"model": "atrack_ak11",
"blocked": false,
"tariff_id": 1294,
"phone": "79161234533",
"status_listing_id": null,
"creation_date": "2021-09-20",
"tariff_end_date": "2021-09-24"
}
"tag_bindings": [],
"clone": false
}
errors:
- 201 - Not found in the database - if tracker not found.
list
Gets user's trackers with optional filtering by labels.
parameters:
name | description | type | format |
labels | Optional. List of tracker label filters. If specified, only trackers that labels contains any of the given filter will be returned. | string array | ["aa", "b"] |
Constraints for labels:
- Labels array size: minimum 1, maximum 1024.
- No null items.
- No duplicate items.
- Item length: minimum 1, maximum 60.
For example, we have trackers with labels "aa1", "bb2", "cc3", if we pass labels=["aa","b"] only trackers containing "aa1" and "bb2" will be returned.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3"}'
'HTTP GET'
https://api.itrack.live/tracker/list?hash=a6aa75587e5c59c32d347da438505fc3
response
{
"success": true,
"list": [{
"id": 123456,
"label": "tracker label",
"clone": false,
"group_id": 167,
"avatar_file_name" : "file name",
"source": {
"id": 234567,
"device_id": 9999999988888,
"model": "telfmb920",
"blocked": false,
"tariff_id": 345678,
"status_listing_id": null,
"creation_date": "2011-09-21",
"tariff_end_date": "2016-03-24",
"phone" : "+71234567890"
},
"tag_bindings": [{
"tag_id": 456789,
"ordinal": 4
}]
}]
}
errors:
General types only.
corrupt
Marks tracker as deleted and corrupt its source, device_id and phone.
required sub-user rights: tracker_register.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 999119 |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/corrupt' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "tracker_id": 265489}'
'HTTP GET'
https://api.itrack.live/tracker/corrupt?hash=a6aa75587e5c59c32d347da438505fc3&tracker_id=265489
response
{
"success": true,
}
errors:
-
13 - Operation not permitted - if tracker already connected to server, or if user has insufficient rights.
- 243 - Device already connected.
- 201 - Not found in the database - if tracker not found.
- 219 - Not allowed for clones of the device - if source tracker is clone itself.
- 252 - Device already corrupted.
- 208 - Device blocked.
delete
Deletes a tracker if it is "clone". Will not work if specified id of the original tracker.
required sub-user rights: admin (available only to master users).
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 999119 |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/delete' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "tracker_id": 265489}'
'HTTP GET'
https://api.itrack.live/tracker/delete?hash=a6aa75587e5c59c32d347da438505fc3&tracker_id=265489
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if tracker not found.
- 249 - Operation available for clones only - if tracker is not clone.
- 203 - Delete entity associated with - if there are some rules or vehicles associated with tracker.
change_phone
Changes tracker's phone and setup new apn.
required sub-user rights: tracker_configure.
parameters:
name | description | type | format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 999119 |
phone | The phone number of the sim card inserted into device in international format without "+" sign. | string | "6156680000" |
apn_name | The name of GPRS APN of the sim card inserted into device. Max length 40. | string | "fast.tmobile.com" |
apn_ user | The user of GPRS APN of the sim card inserted into device. Max length 40, can be empty. | string | "tmobile" |
apn_password | The password of GPRS APN of the sim card inserted into device. Max length 40, can be empty. | string | "tmobile" |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/change_phone' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "tracker_id": 265489, "phone": "6156680000", "apn_name": "fast.tmobile.com", "apn_user": "tmobile", "apn_password": "tmobile"}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if tracker not found.
- 208 - Device blocked - if tracker exists but was blocked due to tariff restrictions or some other reason..
- 219 - Not allowed for clones of the device - if specified tracker is a clone.
- 214 - Requested operation or parameters are not supported by the device - if device does not have GSM module.
- 223 - Phone number already in use - if specified phone number already used in another device.
- 241 - Cannot change phone to bundled sim. Contact tech support. If specified phone number belongs tp sim card bundled with the device.
vehicle/
Contains the vehicle object and API calls to interact with it. This object is used to describe vehicle's information like VIN, speed, consumption and other. Vehicle object should be assigned to tracker object.
Vehicle Object
{
" "id": 222,
"tracker_id": 1,
"label": "AGV",
"max_speed": 90,
"model": "Renault KERAX",
"type": "truck",
"subtype": "tractor",
"garage_id": null,
"trailer" : "trailer1",
"manufacture_year" : 2001,
"color" : "some color",
"additional_info" : "additional info",
"reg_number": "?001??96",
"vin": "TMBJF25LXC6080000",
"chassis_number": "",
"frame_number" : "",
"payload_weight": 32000,
"payload_height": 1.2,
"payload_length": 1.0,
"payload_width": 1.0,
"passengers": 4,
"gross_weight" : null,
"fuel_type": "petrol",
"fuel_grade": "?-80",
"norm_avg_fuel_consumption": 9.0,
"fuel_tank_volume": 50,
"fuel_cost" : 100.3,
"wheel_arrangement": "4x2",
"tyre_size": "255/65 R16",
"tyres_number": 4,
"liability_insurance_policy_number": "12345",
"liability_insurance_valid_till": "2020-10-15",
"free_insurance_policy_number": "",
"free_insurance_valid_till": null,
"icon_id" : 55,
"avatar_file_name": null,
"tags": [1,2]
}
- id - int. An id of a vehicle.
- tracker_id - int. An id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked.
- label - string. Vehicle's label.
- max_speed - int. Maximum speed of a vehicle.
- model - string. Vehicle's model.
- type enum. Vehicle's type. Can be "truck" | "car" | "bus" | "special".
- subtype - optional enum. Depends on type, null means undefined.
- garage_id - nullable int. An id of a garage.
- trailer - optional string. Information about a trailer.
- manufacture_year - optional int. Manufacture year of a vehicle.
- color - optional string. Not RGB. A color of a vehicle.
- additional_info - optional string. Additional info about a vehicle.
- reg_number - string. Reg number/ license plate of a vehicle.
- vin - string. VIN of a vehicle.
- chassis_number - string. Chassis number of a vehicle.
- frame_number - optional string. Frame number of a vehicle.
- payload_weight - int. Payload weight in kilograms.
- payload_height - decimal. Payload height in millimeters.
- payload_length - decimal. Payload length in millimeters.
- payload_width - decimal. Payload width in millimeters.
- passengers - int. A maximum count of passengers.
- gross_weight - optional int. Gross weight in kilograms.
- fuel_type - enum. Can be "petrol" | "diesel" | "gas".
- fuel_grade - string. Grade of fuel used in a vehicle.
- norm_avg_fuel_consumption - decimal. Normal average fuel consumption in liters per 100 km.
- fuel_tank_volume - int. Fuel tank capacity in liters.
- fuel_cost - optional decimal. Cost of fuel used in a vehicle per liter.
- wheel_arrangement - string. Wheel arrangement of a vehicle.
- tyre_size - string. Tyre size.
- tyres_number - int. Number of tyres.
- liability_insurance_policy_number - string. Liability insurance policy number.
- liability_insurance_valid_till - string date. The date till liability insurance valid.
- free_insurance_policy_number - string. Free insurance policy number.
- free_insurance_valid_till - string date. The date till free insurance valid.
- icon_id - nullable int. Can only be updated via avatar/assign.
- avatar_file_name - string. File name.
- tags - int array. List of tag ids.
API actions
API path: /vehicle.
create
Creates a new vehicle.
required sub-user rights: vehicle_update
parameters:
name | description | type |
vehicle | A vehicle object without id field. | JSON Object |
force_reassign | Optional. Default is true. Will reassign the device to created vehicle even if it was assign to another one. | boolean |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/vehicle/create \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "vehicle": {"additional_info": null, "avatar_file_name": null, "chassis_number": "", "color": null, "frame_number": "", "free_insurance_policy_number": "", "free_insurance_valid_till": null, "fuel_cost": null, "fuel_grade": "", "fuel_tank_volume": null, "fuel_type": null, "garage_id": null, "gross_weight": null, "icon_color": "1E96DC", "icon_id": null, "label": "Vehicle", "liability_insurance_policy_number": "", "liability_insurance_valid_till": null, "manufacture_year": 2020, "max_speed": 160, "model": "", "norm_avg_fuel_consumption": null, "passengers": 1, "payload_height": 1868, "payload_length": 2820, "payload_weight": null, "payload_width": 1972, "reg_number": "AB234D", "subtype": "sedan", "tags": [], "tracker_id": null, "trailer": null, "type": "car", "tyre_size": "", "tyres_number": null, "vin": "45468743418579751", "wheel_arrangement": null}}'
response
{
"success": true,
"id": 111
}
errors:
- 247 - Entity already exists, if tracker_id!=null and exists a vehicle that already bound to this tracker_id.
delete
Deletes a vehicle with the specified id.
required sub-user rights: vehicle_update.
parameters:
name | description | type |
vehicle_id | Id of the vehicle to delete. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/vehicle/delete' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "vehicle_id": 127722}'
'HTTP GET'
https://api.itrack.live/vehicle/delete?hash=a6aa75587e5c59c32d347da438505fc3&vehicle_id=127722
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if there is no vehicle with such an id.
list
Gets all vehicles belonging to user.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/vehicle/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3"}'
response
{
"success": true,
"list": [{
"id": 222,
"tracker_id": 1,
"label": "AGV",
"max_speed": 90,
"model": "Renault KERAX",
"type": "truck",
"subtype": "tractor",
"garage_id": null,
"trailer" : "trailer1",
"manufacture_year" : 2001,
"color" : "some color",
"additional_info" : "additional info",
"reg_number": "?001??96",
"vin": "TMBJF25LXC6080000",
"chassis_number": "",
"frame_number" : "",
"payload_weight": 32000,
"payload_height": 1.2,
"payload_length": 1.0,
"payload_width": 1.0,
"passengers": 4,
"gross_weight" : null,
"fuel_type": "petrol",
"fuel_grade": "?-80",
"norm_avg_fuel_consumption": 9.0,
"fuel_tank_volume": 50,
"fuel_cost" : 100.3,
"wheel_arrangement": "4x2",
"tyre_size": "255/65 R16",
"tyres_number": 4,
"liability_insurance_policy_number": "12345",
"liability_insurance_valid_till": "2020-10-15",
"free_insurance_policy_number": "",
"free_insurance_valid_till": null,
"icon_id" : 55,
"avatar_file_name": null,
"tags": [1,2]
}]
}
read
Gets vehicle by specified id.
parameters:
name | description | type |
vehicle_id | Id of a vehicle. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/vehicle/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "vehicle_id": 127722}'
'HTTP GET'
https://api.itrack.live/vehicle/read?hash=a6aa75587e5c59c32d347da438505fc3&vehicle_id=127722
response
{
"success": true,
"value": {
"id": 222,
"tracker_id": 1,
"label": "AGV",
"max_speed": 90,
"model": "Renault KERAX",
"type": "truck",
"subtype": "tractor",
"garage_id": null,
"trailer" : "trailer1",
"manufacture_year" : 2001,
"color" : "some color",
"additional_info" : "additional info",
"reg_number": "?001??96",
"vin": "TMBJF25LXC6080000",
"chassis_number": "",
"frame_number" : "",
"payload_weight": 32000,
"payload_height": 1.2,
"payload_length": 1.0,
"payload_width": 1.0,
"passengers": 4,
"gross_weight" : null,
"fuel_type": "petrol",
"fuel_grade": "?-80",
"norm_avg_fuel_consumption": 9.0,
"fuel_tank_volume": 50,
"fuel_cost" : 100.3,
"wheel_arrangement": "4x2",
"tyre_size": "255/65 R16",
"tyres_number": 4,
"liability_insurance_policy_number": "12345",
"liability_insurance_valid_till": "2020-10-15",
"free_insurance_policy_number": "",
"free_insurance_valid_till": null,
"icon_id" : 55,
"avatar_file_name": null,
"tags": [1,2]
}
}
errors:
- 201 - Not found in the database - if there is no vehicle with such an id.
update
Updates existing vehicle.
required sub-user rights: vehicle_update.
parameters:
name | description | type |
vehicle | A vehicle object. | JSON Object |
force_reassign | Optional. Default is true. Will reassign the device to created vehicle even if it was assign to another one. | boolean |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/vehicle/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "vehicle": {"additional_info": null, "avatar_file_name": null, "chassis_number": "", "color": null, "frame_number": "", "free_insurance_policy_number": "", "free_insurance_valid_till": null, "fuel_cost": null, "fuel_grade": "", "fuel_tank_volume": null, "fuel_type": null, "garage_id": null, "gross_weight": null, "icon_color": "1E96DC", "icon_id": null, "id": 223155, "label": "Vehicle", "liability_insurance_policy_number": "", "liability_insurance_valid_till": null, "manufacture_year": 2020, "max_speed": 160, "model": "", "norm_avg_fuel_consumption": null, "passengers": 1, "payload_height": 1868, "payload_length": 2820, "payload_weight": null, "payload_width": 1972, "reg_number": "AB234D", "subtype": "sedan", "tags": [], "tracker_id": null, "trailer": null, "type": "car", "tyre_size": "", "tyres_number": null, "vin": "45468743418579751", "wheel_arrangement": null}}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if there is no vehicle with such an id.
- 247 - Entity already exists, if tracker_id!=null and exists a vehicle that already bound to this tracker_id.
- 261 - Entity has external links - when tracker_id changes and there are some service tasks associated with this vehicle.
Geofences
Geofences used in rules to limit rule area of activity. Also, geofence names shown in reports after the address, if an event happened inside the geofence.
This document describes CRUD actions for geofences. Note that geofence points handled separately because they are represented by big arrays of data.
Entity Description
zone is JSON object with one of types: sausage, circle or polygon.
circle:
{
"id": 985472,
"type": "circle",
"label": "Zone name",
"address": "Karlsplatz, 2",
"color": "27A9E3",
"radius": 150,
"center": {
"lat": 48.200940,
"lng": 16.369856
},
"tags": [127, 15]
}
- id - int. Geofence ID.
- label - string. Geofence label.
- address - string. Geofence address.
- color - string. Geofence color in 3-byte RGB hex format.
- radius - int. Circle radius in meters.
- center - location object. Location of circle center.
- tags - int array. Array of tag IDs.
polygon:
{
"id": 124597,
"type": "polygon",
"label": "Geofence name",
"address": "Karlsplatz, 2",
"color": "27A9E3",
"tags": [1,236]
}
- id - int. Geofence ID.
- label - string. Geofence label.
- address - string. Geofence address.
- color - string. Geofence color in 3-byte RGB hex format.
- tags - int array. Array of tag IDs.
sausage:
{
"id": 12345,
"type": "sausage",
"label": "Geofence name",
"address": "Karlsplatz, 2",
"color": "27A9E3",
"radius": 150,
"tags": [289]
}
- id - int. Geofence ID.
- label - string. Geofence label.
- address - string. Geofence address.
- color - string. Geofence color in 3-byte RGB hex format.
- radius - int. Polyline radius in meters.
- tags - int array. Array of tag IDs.
API actions
API path: /zone.
batch_convert
Convert batch of tab-delimited circle geofences and return list of checked geofences with errors.
required sub-user rights: zone_update.
parameters:
name | description | type |
batch | Batch of tab-delimited places. | string |
file_id | ID of file preloaded with /data/spreadsheet/parse method. | string |
fields | Optional, array of field names, default is ["label", "address", "lat", "lng", "radius", "tags"]. | enum array |
geocoder | Optional. Geocoder type. | enum |
default_radius | Optional. Radius for point, default is 100. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/zone/batch_convert' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "batch": "Geofence for test Karlsplatz, 2"}'
response
{
"success": true,
"list": [{
"id": null,
"type": "circle",
"label": "Geofence name",
"address": "Karlsplatz, 2",
"color": "27A9E3",
"center": {
"lat": 48.2009935,
"lng": 16.3699642
},
"tags": []
}],
"limit_exceeded": false
}
- id - int. Geofence ID.
- label - string. Geofence label.
- address - string. Geofence address.
- color - string. Geofence color in 3-byte RGB hex format.
- radius - int. Circle radius in meters.
- center - location object. Location of circle center.
- tags - int array. Array of tag IDs.
- limit_exceeded - boolean. true if given batch constrained by limit.
errors:
- 234 - Invalid data format.
create
Creates a new geofence.
required sub-user rights: zone_update.
parameters:
name | description | type |
zone | zone JSON-object without id and color fields. | JSON object |
points | Array of new points for this geofence. Must contain at least 3 elements. MUST be omitted if zone does not support points (e.g. circle). | array of zone point objects |
zone.color | Optional. Geofence color in 3-byte RGB hex format. Default is "27A9E3". | string |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/zone/create' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "zone": {"label": "Zone name", "address": "zone address", "radius": 100, "center": {"lat": 56.827001, "lng": 60.594296}}}'
response
{
"success": true,
"id": 1234567
}
errors:
- 202 - Too many points in a geofence - max allowed points count for a geofence is 100 for a polygon or 1024 for sausage.
- 230 - Not supported for this entity type - if "points" were specified, but geofence cannot have any points associated with it (e.g. if geofence is circle).
- 268 - Over quota - if the user's quota for geofences exceeded.
delete
Deletes user's geofence by zone_id or array of zone_ids.
required sub-user rights: zone_update.
parameters:
name | description | type |
zone_id | Id of a geofence. | int |
zone_ids | Array of geofence ids. | int array |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/zone/delete' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "zone_id": 1234567}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database.
- 203 - Delete entity associated with.
list
Gets all user geofences.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/zone/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
'HTTP GET'
https://api.itrack.live/zone/list?hash=a6aa75587e5c59c32d347da438505fc3
response
{
"success": true,
"list": [{
"id": 12345,
"type": "sausage",
"label": "Zone name",
"address": "Karlsplatz, 2",
"color": "27A9E3",
"radius": 150,
"tags": [289]
}]
}
- list - array of objects. Geofence objects without points field.
update
Update geofence parameters for the specified geofence. Note that geofence must exist, must belong to the current user, and its type cannot be changed. E.g. if you already have a geofence with ID=1 which type is "circle", not possible to submit a geofence which type is "polygon".
required sub-user rights: zone_update.
parameters:
name | description | type |
zone | Geofence JSON-object without id and color fields. | JSON Object |
zone.color | Optional. Geofence color in 3-byte RGB hex format. Default is "27A9E3". | string |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/zone/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "zone": {"label": "Zone name", "address": "zone address", "radius": 100, "center": {"lat": 56.827001, "lng": 60.594296}}}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if geofence with the specified ID cannot be found or belongs to another user.
- 231 - Entity type mismatch - if type of the submitted geofence differs from type of the geofence currently stored in the database.
Transaction
Transaction object description and API call to get list of user's billing transactions for the specified period.
Transaction Object
{
"description": "Recharge bonus balance during tracker registration",
"type": "bonus_charge",
"subtype": "register",
"timestamp": "2021-01-28 08:16:40",
"user_id": 12203,
"dealer_id": 5001,
"tracker_id": 303126,
"amount": -10.0000,
"new_balance": 800.0000,
"old_balance": 810.0000,
"bonus_amount": 10.0000,
"new_bonus": 10.0000,
"old_bonus": 0.0000,
}
- description - string. Transaction description.
- type - enum. Type of transaction.
- subtype - enum. Subtype of transaction.
- timestamp - date/time. When transaction created.
- user_id - int. ID of a user which made a transaction.
- dealer_id - int. ID of a dealer.
- tracker_id - int. Tracker id. 0 if transaction not associated with tracker.
- amount - double. Amount of money in transaction, can be negative. e.g. -10.0000 means 10 money units removed from user`s balance.
- new_balance - double. User`s money balance after transaction.
- old_balance - double. User`s money balance before transaction.
- bonus_amount - double. Amount of bonus used in transaction, can be negative. e.g. 10.0000 means 10 bonuses units added to user`s bonus balance.
- new_bonus - double. User`s bonus balance after transaction.
- old_bonus - double. User`s bonus balance before transaction.
API actions
API path: /transaction.
list
Gets list of user's billing transactions for the specified period.
required sub-user rights: payment_create.
parameters:
name | description | type |
from | Start date/time for searching. | date/time |
to | End date/time for searching. Must be after from date. | date/time |
limit | Optional. Maximum number of returned transactions. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/transaction/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "from": "2021-01-20 08:16:40", "to": "2021-01-28 08:16:40"}'
response
{
"success": true,
"list": [{
"description": "Recharge bonus balance during tracker registration",
"type": "bonus_charge",
"subtype": "register",
"user_id": 12203,
"dealer_id": 5001,
"tracker_id": 303126,
"amount": -10.0000,
"new_balance": 800.0000,
"old_balance": 810.0000,
"bonus_amount": 10.0000,
"new_bonus": 10.0000,
"old_bonus": 0.0000
}],
}
- list - array of objects. List of transactions objects.
errors:
- 211 - Requested time span is too big - more than report.maxTimeSpan.
User
A user account lets you start working with the platform as well as customize your experience within it. Contains user object structure and API calls to interact with users.
User Object Structure
{
"success": true
"paas_id": 7,
"paas_settings":
,
"user_info": {
"id": 43568,
"login": "demo@itrack.live",
"title": "John Smith",
"phone": "79123456789",
"creation_date": "2016-05-20 01:10:34",
"balance": 74.31,
"bonus": 0,
"locale": "en_US",
"demo": true,
"verified" : true,
"legal_type" : "individual",
"default_geocoder": "google",
"route_provider": "google",
"time_zone": "America/New_York",
"measurement_system" : "metric",
"tin": "2345678239",
"iec": "",
"post_country": "USA",
"post_region": "NY",
"post_index": "10120",
"post_city": "New York",
"post_street_address": "1556 Broadway, suite 416",
"registered_country": "USA",
"registered_region": "NY",
"registered_index": "10120",
"registered_city": "New York",
"registered_street_address": "1556 Broadway, suite 416",
"first_name": "John",
"middle_name": "Walker",
"last_name": "Smith",
"legal_name": "QWER Inc."
}
"master": {
"id": 1234,
"demo": false,
"legal_type": "individual",
"first_name": "David",
"middle_name": "Middle",
"last_name": "Blane",
"legal_name": "Blah LLC",
"title": "David Blane",
"balance": 0.0,
"bonus": 89.78
},
"tariff_restrictions": {
},
"premium_gis": true,
"features": ["branding_web"],
"privileges": {
"rights": ["tag_update"]
}
}
-
paas_id - int. Dealer id.
- paas_settings - object. The same as settings in /dealer/get_ui_config response.
- user_info - object. Info about user.
- id - int. User id.
- login - string. User's login (in most cases it's an email address).
- title - string. User first and last name or organization title.
- phone - string. User phone (if not empty).
- creation_date - date/time. User registration date/time.
- balance - float. User balance, max. 2 digits after dot. For sub-users, this field should be ignored.
- bonus - float. User bonus, max. 2 digits after dot. For sub-users, this field should be ignored.
- locale - enum. User locale, for example "en_EN".
- demo - boolean. true if this is a demo user, false otherwise.
- verified - boolean. true if user email already verified.
- legal_type - enum. Can bed "legal_entity", "individual" or "sole_trader".
- default_geocoder - enum. User's default geocoder. Can be "google", "yandex", "progorod", "osm", or "locationiq".
- route_provider - enum. User's route provider. Can be "progorod", "google" or "osrm".
- time_zone - enum. User timezone name.
- measurement_system - enum. User's measurement system "metric", "imperial", "us", "metric_gal_us" or "nautical".
- tin - string. Taxpayer identification number aka "VATIN" or "INN".
- iec - optional string. Industrial Enterprises Classifier aka "KPP". Used in Russia for legal entities.
- post_country - string. Country part of user's post address.
- post_index - string. Post index or ZIP code.
- post_region - string. Region part of post address (oblast, state, etc.).
- post_city - string. City from postal address.
- post_street_address - string. Street address.
- registered_country - string. Country part of user's registered address.
- registered_index - string. Index part of user's registered address.
- registered_region - string. Region part of user's registered address.
- registered_city - string. City from registered address.
- registered_street_address - string. User's registered address.
- first_name - string. User's or contact person first name.
- middle_name - string. User's or contact person middle name.
- last_name - string. User's or contact person last name.
- legal_name - optional string. A juridical name.
- master - object. Returned only if current user is sub-user. All fields have same meaning as in "user_info", but for master user's account.
- tariff_restrictions - tariff restrictions object, for more info see user/get_tariff_restrictions.
- allowed_maps - string array. List of allowed maps.
- premium_gis - boolean. true if a dealer has premium GIS tariff.
- features - string array. Set of allowed Dealer features.
- privileges - object only returned for sub-users. Describes effective sub-user privileges.
- rights - string array. A set of rights granted to sub-user. Described in security group rights.
API actions
API path: /user.
activate
Activates previously registered user with the provided session hash (it is contained in activation link from email sent to user). Available only to master users.
Attention: This call will receive only session hash from registration email. Any other hash will result in result error code 4 (User or API key not found or session ended). The only thing that API calls with a user session will work for is creating, reading, and deleting API keys.
response
{
"success": true,
}
auth
Tries to authenticate user and get hash.
It does not need authentication/hash and is available at UNAUTHORIZED access level.
Session hash is deprecated: To work with the API, it is necessary to use the API key, not the user's session hash. Work with API through the user's session is deprecated and will be disabled in the future.
parameters:
name | description | type |
login | User email as login (or demo login). | string |
password | userpassword | string |
dealer_id | Optional. If specified, API will check that user belongs to this dealer, and if not, error 102 will be returned. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/user/auth' \
-H 'Content-Type: application/json' \
-d '{"login": "user@email.com", "password": "12@14Y$"}'
response
{
"success": true,
"hash": "22eac1c27af4be7b9d04da2ce1af111b"
}
- hash - string. Session hash.
errors:
- 11 - Access denied - if dealer blocked.
- 102 - Wrong login or password.
- 103 - User not activated.
- 104 - Logins limit exceeded, please reuse existing sessions instead (see also user/session/renew).
- 105 - Login attempts limit exceeded, try again later.
get_info
Gets user information and some settings.
parameters:
Only API key hash.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/user/get_info' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true
"paas_id": 7,
"paas_settings":
,
"user_info": {
"id": 43568,
"login": "demo@itrack.live",
"title": "John Smith",
"phone": "79123456789",
"creation_date": "2016-05-20 01:10:34",
"balance": 74.31,
"bonus": 0,
"locale": "en_US",
"demo": true,
"verified" : true,
"legal_type" : "individual",
"default_geocoder": "google",
"route_provider": "google",
"time_zone": "America/New_York",
"measurement_system" : "metric",
"tin": "2345678239",
"iec": "",
"post_country": "USA",
"post_region": "NY",
"post_index": "10120",
"post_city": "New York",
"post_street_address": "1556 Broadway, suite 416",
"registered_country": "USA",
"registered_region": "NY",
"registered_index": "10120",
"registered_city": "New York",
"registered_street_address": "1556 Broadway, suite 416",
"first_name": "John",
"middle_name": "Walker",
"last_name": "Smith",
"legal_name": "QWER Inc."
}
"master": {
"id": 1234,
"demo": false,
"legal_type": "individual",
"first_name": "David",
"middle_name": "Middle",
"last_name": "Blane",
"legal_name": "Blah LLC",
"title": "David Blane",
"balance": 0.0,
"bonus": 89.78
},
"tariff_restrictions": {
},
"premium_gis": true,
"features": ["branding_web"],
"privileges": {
"rights": ["tag_update"]
}
}
- user_object - for more info see user object structure.
get_tariff_restrictions
Gets user tariff restrictions.
parameters:
Only API key hash.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/user/get_tariff_restrictions' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
"value": {
"allowed_maps": ["roadmap","osm"]
}
}
- allowed_maps - string array. List of allowed maps.
logout
Destroys current user session. Works only with standard user session (not with API key).
parameters:
Only API key hash.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/user/logout' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
}
resend_activation
Sends a new activation link to user.
It does not need authentication/hash and is available at UNAUTHORIZED access level.
parameters:
name | description | type |
login | User login (email). | string (Not NULL) |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/user/resend_activation' \
-H 'Content-Type: application/json' \
-d '{"login": "user@login.com"}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database - user with a passed login not found.
- 209 - Failed sending email - can't send email.
- 264 - Timeout not reached - previous activation link generated less than 5 minutes ago (or other configured on server timeout).
{
"success": false,
"status": {
"code": 264,
"description": "Timeout not reached"
},
"timeout": "PT5M",
"remainder": "PT4M31.575S"
}
- timeout - string. timeout between sending activation links in ISO-8601 duration format.
- remainder - string. remaining time to next try in ISO-8601 duration format
- 265 - Already done - user already activated and verified.
How to Work With Statuses
Statuses are used to track current employee activity (in fact, of tracking devices owned by employees). The simplest example is "busy" | "not busy". This is a status listing consisting of two elements (working statuses). Different trackers can be assigned different status lists.
Create
We need to create a working status list that we will assign to the device. Based on the working statuses that are created for the sheet - we will have a choice - what working status can be assigned to the tracker.
To create the working status list we need only one parameter: * listing - status_listing object without "id" and "entries" fields.
For example, we will create a working status list for the delivery service to allow drivers and supervisors to change the working status. Drivers can change their working status using the X-GPS app. Supervisors can change working status using the UI.
API Request:
'cURL'
curl -X POST 'https://api.itrack.live/status/listing/create' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing": {"label": "Delivery_service", "employee_controlled": true, "supervisor_controlled": true}'
response
{
"success": true,
"id": 1111
}
When we created a working status list, we need to fill it with working statuses, and we should use one request per one working status.
For example, we have 4 working statuses: "Free", "Break", "Pick up the goods from storage", "Deliver goods".
'cURL'
curl -X POST 'https://api.itrack.live/status/create' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "listing_id": 1111, "status": {"label": "Free", "color": "E57373"}}'
The response will contain id of a new working status:
{
"success": true,
"id": 1
}
Assign
To assign the working status list to some devices, we use the tracker_id and listing_id.
For example, we have 10 drivers. We should create 10 requests for assigning the working status list to them.
API Request:
'cURL'
curl -X POST 'https://api.itrack.live/status/listing/tracker/assign' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "tracker_id": 615487, "listing_id": 111}'
The platform will notify you about success in reply.
After that, our drivers and supervisors will have access to change working statuses. Where they could be used: We can create a script that will assign a new task to a driver with the working status "Free". After assigning the task, this script will change the working status itself to "Pick up the goods from storage". Or when the task was completed, a script changes the working status to "Free" and gets fields from the ERP system, parses them to create a new task assigns this task to a driver and so on.
Subscription
API calls to interact with payment subscriptions
API actions
API path: /subscription.
/subscription/avangate/
Working with 2Checkout (formerly Avangate) subscriptions (renewals).
Cancel
Unsubscribe from auto-renewal by reference.
required sub-user rights: payment_create.
parameters:
name | description | type |
reference | Internal 2Checkout (formerly Avangate) subscription code. Get it from list call. | string |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subscription/avangate/cancel' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "reference": "5EAD4B0B2F"}'
response
{
"success": true,
}
errors:
- 215 - External service error.
list
List active 2Checkout formerly Avangate subscriptions (renewals).
required sub-user rights: payment_create.
parameters:
Only API key hash.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subscription/avangate/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
"list": [{
"reference": "5EAD4B0B2F",
"code": "4679109",
"quantity": 123,
"expiration_date": "2021-01-28 13:32:11"
}]
}
- reference - string. Internal 2Checkout (formerly Avangate) subscription code. Pass it to /subscription/avangate/cancel.
- code - string. 2Checkout (formerly Avangate) product code.
- quantity - int. Count.
- expiration_date - date/time. Next renew date/time.
errors:
- 215 - External service error.
Subuser
Contains API calls related to sub-users, that is, additional users who have access to your account and monitoring assets. Sub-users is a convenient way for corporate clients to provide multiple employees, who have different roles and privileges, with access to the monitoring system.
"Usual" user account called "master account" in relation to sub-users.
Every sub-user can operate on a subset of trackers from your "master account". Every entity, which is associated with unavailable trackers, also becomes hidden from sub-user. This is called "scoping". Sub-users' rights can also be limited to prevent unauthorized changes to your data and application setting.
NOTE: Sub-users cannot have any "exclusive" objects. Every tracker, rule, task, etc., even created or edited by sub-user, still belongs to your account. The only exception is reporting system: every sub-user has its own reports pool and reports schedule.
Subuser Structure
Sub-user object is almost identical to usual user.
{
"id": 103,
"activated": true,
"login": "user@test.com",
"first_name": "Charles",
"middle_name": "Henry",
"last_name": "Pearson",
"legal_type": "legal_entity",
"phone": "491761234567",
"post_country": "Germany",
"post_index": "61169",
"post_region": "Hessen",
"post_city": "Wiesbaden",
"post_street_address": "Marienplatz 2",
"registered_country": "Germany",
"registered_index": "61169",
"registered_region": "Hessen",
"registered_city": "Wiesbaden",
"registered_street_address": "Marienplatz 2",
"state_reg_num": "12-3456789",
"tin": "1131145180",
"legal_name": "E. Biasi GmbH",
"iec": "",
"security_group_id": 333,
"creation_date": "2016-05-20 00:00:00"
}
-
id - int. Sub-user id, can be null (when creating new sub-user).
- activated - boolean. true if sub-user activated (allowed to login)
- login - string. Sub-user email as login. Must be valid unique email address.
- first_name - string. Sub-user's or contact person first name./li>
- middle_name - string. Sub-user's or contact person middle name.
- last_name - string. Sub-user's or contact person last name.
- legal_type - enum. Can bed "legal_entity", "individual" or "sole_trader".
- phone - string. Sub-user's or contact phone (10-15 digits).
- post_country - string. Country part of sub-user's post address.
- post_index - string. Index part of sub-user's post address.
- post_region - string. Region part of sub-user's post address.
- post_city - string. City from postal address.
- post_street_address - string. Street address.
- registered_country - string. Country part of sub-user's registered address.
- registered_index - string. Index part of sub-user's registered address.
- registered_region - string. Region part of sub-user's registered address.
- registered_city - string. City from registered address.
- registered_street_address - string. Sub-user's registered address.
- state_reg_num - string. State registration number. E.g. EIN in USA, OGRN in Russia. 15 characters max.
- tin - string. Taxpayer identification number aka "VATIN" or "INN".
- legal_name - string. Sub-user's legal name (for "legal_entity" only).
- iec - optional string. Industrial Enterprises Classifier aka "KPP" (used in Russia. For "legal_entity" only).
- security_group_id - int. An id of the security group to which sub-user belongs to. Can be null, which means default group with no privileges.
- creation_date - date/time. Date and time when sub-user was created. This field is read-only, it should not be used in subuser/update.
API actions
API path: /subuser.
delete
Deletes sub-user. This operation cannot be reversed.
required tariff features: multilevel_access - for ALL trackers.
required sub-user rights:admin (available only to master users).
parameters:
name | description | type |
subuser_id | Id of the sub-user belonging to current account. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subuser/delete' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "subuser_id": 123567}'
response
{
"success": true,
}
errors:
- 13 - Operation not permitted - if user has insufficient rights.
- 236 - Feature unavailable due to tariff restrictions - if there is at least one tracker without multilevel_access tariff feature.
- 201 - Not found in the database - if sub-user with such an id does not exist or does not belong to current master user.
list
List all sub-users belonging to current user.
required tariff features: multilevel_access - for ALL trackers. required sub-user rights:admin (available only to master users).
parameters:
Only API key hash.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subuser/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
"list": [{
"id": 103,
"activated": true,
"login": "user@test.com",
"first_name": "Charles",
"middle_name": "Henry",
"last_name": "Pearson",
"legal_type": "legal_entity",
"phone": "491761234567",
"post_country": "Germany",
"post_index": "61169",
"post_region": "Hessen",
"post_city": "Wiesbaden",
"post_street_address": "Marienplatz 2",
"registered_country": "Germany",
"registered_index": "61169",
"registered_region": "Hessen",
"registered_city": "Wiesbaden",
"registered_street_address": "Marienplatz 2",
"state_reg_num": "12-3456789",
"tin": "1131145180",
"legal_name": "E. Biasi GmbH",
"iec": "",
"security_group_id": 333,
"creation_date": "2016-05-20 00:00:00"
}]
}
- list - array of objects. List of all sub-users belonging to this master account.
errors:
- 13 - Operation not permitted - if user has insufficient rights.
- 236 - Feature unavailable due to tariff restrictions - if there is at least one tracker without multilevel_access tariff feature.
register
Allows you to create sub-users associated to your master account.
required tariff features: multilevel_access - for ALL trackers.
required sub-user rights:admin (available only to master users).
parameters:
name | description | type |
user | subuser object without id field. | JSON Object |
password | New sub-user's password. 6 to 20 characters. | string |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subuser/register' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "user": {"activated": true, "login": "user@test.com", "first_name": "Charles", "middle_name": "Henry", "last_name": "Pearson", "legal_type": "legal_entity", "phone": "491761234567", "post_country": "Germany", "post_index": "61169", "post_region": "Hessen", "post_city": "Wiesbaden", "post_street_address": "Marienplatz 2", "registered_country": "Germany", "registered_index": "61169", "registered_region": "Hessen", "registered_city": "Wiesbaden", "registered_street_address": "Marienplatz 2", "state_reg_num": "12-3456789", "tin": "1131145180", "legal_name": "E. Biasi GmbH", "iec": "", "security_group_id": 333}}'
response
{
"success": true,
"id": 121458
}
- id - int. An id of the created sub-user.
errors:
- 13 - Operation not permitted - if user has insufficient rights.
- 236 - Feature unavailable due to tariff restrictions - if there is at least one tracker without multilevel_access tariff feature.
- 201 - Not found in the database - when specified security_group_id does not exist.
- 206 - login already in use - if this login email already registered.
update
Updates sub-user data.
required tariff features: multilevel_access - for ALL trackers.
required sub-user rights:admin (available only to master users).
parameters:
name | description | type |
user | subuser object with id field. | JSON Object |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/subuser/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "user": {"id": 123451, "activated": true, "login": "user@test.com", "first_name": "Charles", "middle_name": "Henry", "last_name": "Pearson", "legal_type": "legal_entity", "phone": "491761234567", "post_country": "Germany", "post_index": "61169", "post_region": "Hessen", "post_city": "Wiesbaden", "post_street_address": "Marienplatz 2", "registered_country": "Germany", "registered_index": "61169", "registered_region": "Hessen", "registered_city": "Wiesbaden", "registered_street_address": "Marienplatz 2", "state_reg_num": "12-3456789", "tin": "1131145180", "legal_name": "E. Biasi GmbH", "iec": "", "security_group_id": 333}}'
response
{
"success": true,
}
errors:
- 13 - Operation not permitted - if user has insufficient rights.
- 236 - Feature unavailable due to tariff restrictions - if there is at least one tracker without multilevel_access tariff feature.
- 201 - Not found in the database - if sub-user with such an id does not exist or does not belong to current master user. Also, when specified security_group_id does not exist.
tag/set
Set tags for a tracker. Tags must be created.
parameters:
name | description | type | Format |
tracker_id | Id of the tracker (aka "object_id"). Tracker must belong to authorized user and not be blocked. | int | 999119 |
tag_bindings | List of tag_binding objects. | array of JSON objects | [{"tag_id" : 1, "ordinal" : 1}, {"tag_id" : 2, "ordinal" : 2}] |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/tracker/tags/set' \
-H 'Content-Type: application/json' \
-d '{"hash": "a6aa75587e5c59c32d347da438505fc3", "tracker_id": 123456, "tag_bindings": "[{"tag_id" : 1, "ordinal" : 1}, {"tag_id" : 2, "ordinal" : 2}]"}'
response
{
"success": true,
}
Tariff
API calls for interaction with tariff plans.
Tariff Object
{
"id": 12163,
"name": "Premium",
"group_id": 3,
"active": true,
"type": "monthly",
"price": 12.55,
"early_change_price": 23.0,
"device_limit": 2000,
"has_reports": true,
"store_period": "1y",
"device_type": "tracker",
"proportional_charge": false,
"service_prices": {
"incoming_sms": 0.3,
"outgoing_sms": 0.3,
"service_sms": 0.2,
"phone_call": 0.6,
"traffic": 0.09
}
}
- id - int. Tariff ID.
- name - string. Tariff name.
- group_id - int. Tariff group number.
- active - boolean. true if user allowed change his current tariff to this one.
- type - enum. Type of tariff. Can be "monthly" or "activeday" (for "tracker" device_type only).
- price - double. Tariff subscription price (usually per month).
- early_change_price - double. Price of change tariff from current to other. With the last change in less than 30 days (tariff.freeze.period config option). When not passed or null user cannot change tariff frequently.
- device_limit - int. A maximum limit of devices per user. Not used for cameras and sockets.
- has_reports - boolean. If true the tariff has reports.
- store_period - string. Data storage period, e.g. "2h" (2 hours), "3d" (3 days), "5m" (5 months), "1y" (one year).
- device_type - enum. Device type. Can be "tracker", "camera" or "socket".
- proportional_charge - boolean. true if monthly fee will be smaller when device was blocked during month (for "monthly" tariffs only).
- service_prices - JSON object with service prices.
- incoming_sms - double. Incoming sms price.
- outgoing_sms - double. Outgoing sms price.
- service_sms - double. Service sms price.
- phone_call - double. Phone voice notification sms price.
- traffic - double. Traffic price per 1 MB.
API actions
API path: panel/tariff.
create
Creates a new tariff.
required permissions: "tariffs": "create".
parameters:
name | description | type |
tariff | Tariff object without ID field. | JSON object |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/panel/tariff/create' \
-H 'Content-Type: application/json' \
-d '{"hash": "fa7bf873fab9333144e171372a321b06", "tariff": {"name": "Premium", "group_id": 3, "active": true, "type": "monthly", "price": 12.55, "early_change_price": 23.0, "device_limit": 2000, "has_reports": true, "store_period": "1y", "device_type": "tracker", "proportional_charge": false, "service_prices": {"incoming_sms": 0.3, "outgoing_sms": 0.3, "service_sms": 0.2, "phone_call": 0.6, "traffic": 0.09}}}'
response
{
"success": true,
"id" : 123568
}
- id - int. An id of the created tariff.
errors:
- 201 - Not found in the database - if specified tariff does not exist or belongs to different dealer.
- 214 - Requested operation or parameters are not supported by the device - when device_type does not support specified tariff type.
- 244 - Duplicate entity label - if there's another dealer's tariff with the same name.
list
Returns list of all tariffs belonging to dealer.
If "filter" is used, entities will be returned only if filter string contains one of the following fields: id, name, price, device_type.
required permissions: "tariffs": "read".
parameters:
name | description | type |
device_type | Optional. Filter by device type. One of "tracker", "camera" or "socket". | ENUM |
filter | Optional. Text filter. | string |
order_by | Optional. List ordering. One of: id, name, device_type, group_id, price. | string |
ascending | Optional. Default is true. If true, ordering will be ascending, descending otherwise. | boolean |
offset | Optional. Default is 0. Starting offset, used for pagination. | int |
limit | Optional. Max number of records to return, used for pagination. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/panel/tariff/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "fa7bf873fab9333144e171372a321b06"}'
response
{
"success": true,
"list": [{
"id": 12163,
"name": "Premium",
"group_id": 3,
"active": true,
"type": "monthly",
"price": 12.55,
"early_change_price": 23.0,
"device_limit": 2000,
"has_reports": true,
"store_period": "1y",
"device_type": "tracker",
"proportional_charge": false,
"service_prices": {
"incoming_sms": 0.3,
"outgoing_sms": 0.3,
"service_sms": 0.2,
"phone_call": 0.6,
"traffic": 0.09
}
}]
"wholesale_service_prices" : {
"incoming_sms": 0.27,
"outgoing_sms": 0.27,
"service_sms": 0.17,
"phone_call": 0.55,
"traffic": 0.05
}
"count" : 42
}
- list - objects array. List of tariff plans.
- wholesale_service_prices - JSON object. Wholesale prices for all services (what dealer will pay per sms, per call, per mb).
- count - int. Total number of records (ignoring offset and limit).
read
Returns tariff with specified id.
required permissions: "tariffs": "read".
parameters:
name | description | type |
tariff_id | Tariff ID to read. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/panel/tariff/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "fa7bf873fab9333144e171372a321b06", "tariff_id": 12163}'
response
{
"success": true,
"value": {
"id": 12163,
"name": "Premium",
"group_id": 3,
"active": true,
"type": "monthly",
"price": 12.55,
"early_change_price": 23.0,
"device_limit": 2000,
"has_reports": true,
"store_period": "1y",
"device_type": "tracker",
"proportional_charge": false,
"service_prices": {
"incoming_sms": 0.3,
"outgoing_sms": 0.3,
"service_sms": 0.2,
"phone_call": 0.6,
"traffic": 0.09
}
}
}
errors:
- 201 - Not found in the database - if specified tariff does not exist or belongs to different dealer.
update
Updates existing tariff.
required permissions: tariffs: "update".
parameters:
name | description | type |
tariff | Tariff object without device_type field | JSON Object |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/panel/tariff/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "fa7bf873fab9333144e171372a321b06", "tariff": {"id": 12345, "name": "Premium", "group_id": 3, "active": true, "type": "monthly", "price": 12.55, "early_change_price": 23.0, "device_limit": 2000, "has_reports": true, "store_period": "1y", "proportional_charge": false, "service_prices": {"incoming_sms": 0.3, "outgoing_sms": 0.3, "service_sms": 0.2, "phone_call": 0.6, "traffic": 0.09}}}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database - if specified tariff does not exist or belongs to different dealer.
- 214 - Requested operation or parameters are not supported by the device when device_type does not support specified tariff type.
- 244 - Duplicate entity label - if there's another dealer's tariff with the same name.
Timezone
Contains an API call to get information about all supported timezones.
API actions
API path: /timezone.
list
Information about all supported timezones for the specified locale. Does not require user authorization.
parameters:
name | description | type |
locale | Name of locale. | ENUM |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/timezone/list' \
-H 'Content-Type: application/json' \
-d '{"locale": "En-en"}'
response
{
"success": true,
"list": [{
"zone_id": "Australia/Sydney",
"description": "Sydney",
"base_offset": 10.0,
"dst_offset": 1,
"country_code": "AU",
"alt_ids": ["Australia/ACT", "Australia/Canberra", "Australia/NSW"]
}]
}
- zone_id - string. Timezone ID, which is used throughout the API.
- description - string. Localized description of the timezone.
- base_offset - double. Base timezone offset in hours, e.g. 10 means UTC +10. May be negative or fractional!
- dst_offset - int. DST offset in hours (0 if no DST rules for this timezone).
- country_code - string. ISO country code for the timezone.
- alt_ids - string array. List of strings, optional, alternative timezone IDs.
Working With Tasks
You can assign task to any tracked device. If specified tracker visits task checkpoint at the specified time and meets other conditions such as filling form or staying in the task zone for the specified time, the task completed. Otherwise, the task either failed completely or completed with warnings.
If task assigned to a Mobile Tracker App (Android / iOS), it's available for viewing by app user. User will also receive notifications of newly assigned tasks, task changes, etc.
Task Object
{
"id": 111,
"user_id": 3,
"tracker_id": 22,
"location": {
"lat": 56.5,
"lng": 60.5,
"address": "Fichtenstrasse 11",
"radius": 150
},
"label": "Deliver parcels",
"description": "Quickly",
"creation_date": "2014-01-02 03:04:05",
"from": "2014-02-03 04:05:06",
"to": "2014-03-04 05:06:07",
"external_id": null,
"status": "assigned",
"status_change_date": "2014-01-02 03:04:05",
"max_delay" : 5,
"min_stay_duration": 0,
"arrival_date": "2014-01-02 03:04:05",
"stay_duration": 0,
"origin": "imported",
"tags": [1, 2],
"type": "task",
"form": form_object,
"form_template_id": 13245,
"fields": {
"131312" : {
"type": "text",
"value": "I love text!"
}
}
}
- id - int. Primary key. Used in task/update, IGNORED in task/create.
- user_id - int. User id. IGNORED in create/update.
- tracker_id - int. An id of the tracker to which task assigned. Can be null. IGNORED in task/update.
- location - location associated with this task. Cannot be null.
- address - string. Address of the location.
- radius- int. Radius of location zone in meters.
- creation_date - date/time. When task created. IGNORED in create/update.
- from - date/time. Date AFTER which task zone must be visited.
- to - date/time. Date BEFORE which task zone must be visited.
- external_id - string. Used if task imported from external system. Arbitrary text string. Can be null.
- status - enum. Task status. IGNORED in create/update. Can have "unassigned" value (unassigned to any executor), "assigned", "done", "failed", "delayed", "arrived" (arrived to geofence but haven't done the task), "faulty" (with problems).
- status_change_date - date/time. When task status changed. IGNORED in create/update.
- max_delay - int. Maximum allowed task completion delay in minutes.
- min_stay_duration - int. Minimum duration of stay in task zone for task completion, minutes.
- arrival_date - date/time. When tracker has arrived to the task zone. IGNORED in create/update.
- stay_duration - int. Duration of stay in the task zone, seconds.
- origin - string. Task origin. IGNORED in create/update.
- tags - int array. List of tag ids.
- form - form object. If present.
- form_template_id - int. An id of form template. Used in create and update actions only if create_form parameter is true in them.
- fields - optional object. A map, each key of which is a custom field id as a string. See entity/fields
API actions
API path: /task.
assign
(Re)assigns task to new tracker (or make it unassigned).
required sub-user rights: task_update.
parameters:
name | description | type |
task_id | Id of the task to assign. | int |
tracker_id | Id of the tracker. Tracker must belong to authorized user and not be blocked. If null, task will be assigned to no one. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/assign' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task_id": 23144, "tracker_id": 132421}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database (if there is no task with such an id).
- 204 - Entity not found (if there is no tracker with such id belonging to authorized user).
- 208 - Device blocked (if tracker exists but was blocked due to tariff restrictions or some other reason).
- 255 - Invalid task state (if current task state is not "unassigned" or "assigned").
- 236 - Feature unavailable due to tariff restrictions (if device's tariff does not allow usage of tasks).
batch_convert
Converts batch of tab-delimited tasks and return list of checked tasks with errors.
required sub-user rights: task_update.
parameters:
name | description | type |
batch | Batch of tab-delimited tasks. | string |
fields | Optional. Array of field names, default is ["label", "from", "to", "address", "lat", "lng", "description"]. | string array |
geocoder | Geocoder type. | ENUM |
default_radius | Optional. Radius for point, default is 100. | int |
default_max_delay | Optional. Max delay for tasks, default is 0. | int |
default_duration | Optional. Duration for task in minutes, default is 60. | int |
default_min_stay_duration | Optional. Minimal stay duration for task in minutes, default is 0. | int |
location_check_mode | Optional. One of "no_check", "entity_location", "parent_location" | ENUM |
employee_ids | Optional. List of employee Ids to automatic assign | int array |
vehicle_ids | Optional. List of vehicle Ids to automatic assign | int array |
In case of location_check_mode==entity_location - vehicle_ids will be ignored.
response
{
"success": true,
"list": [{
"id": 111,
"user_id": 3,
"tracker_id": 22,
"location": {
"lat": 56.5,
"lng": 60.5,
"address": "Fichtenstrasse 11",
"radius": 150
},
"label": "Deliver parcels",
"description": "Quickly",
"creation_date": "2014-01-02 03:04:05",
"from": "2014-02-03 04:05:06",
"to": "2014-03-04 05:06:07",
"external_id": null,
"status": "assigned",
"status_change_date": "2014-01-02 03:04:05",
"max_delay" : 5,
"min_stay_duration": 0,
"arrival_date": "2014-01-02 03:04:05",
"stay_duration": 0,
"origin": "imported",
"tags": [1, 2],
"type": "task",
"form": form_object,
"errors": [error_object]
}],
"limit_exceeded": false
}
- list - list of checked task objects that contain all fields from task and field errors.
- errors - array of objects. Optional. List of errors.
- limit_exceeded - boolean. true if given batch constrained by a limit.
count
Returns total number of tasks belonging to current user.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/count' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
"count": 111
}
- count - int. Number of tasks.
create
Creates a new task.
required sub-user rights: task_update.
parameters:
name | description | type |
task | task object without fields which are IGNORED | JSON object |
creat_form | If true then check additional form_template_id field in task object and create form if it is not null. Default value is false for backward compatibility. | booolean |
Minimal JSON object to create a new task must contain:
{
"tracker_id": 22,
"location": {
"lat": 56.83717295,
"lng": 60.59761920,
"radius": 150
},
"label": "Name",
"description": "Description example",
"from": "2020-02-03 04:05:06",
"to": "2020-03-04 05:06:07"
}
- tracker_id - int. Optional. if the field specified then the task will be assigned to the employee associated with the tracker, otherwise it won't be assigned to anybody.
- location - area (circle geofence), entering and leaving of geofence will be controlled.
- lat - float. Latitude.
- lng - float. Longitude.
- radius - int. Radius in meters.
- label - string. Task name, length 1-200 characters.
- description - string. Task description, length 0-1024 characters.
- from - date/time. Start date of the interval - when the specified location has to be visited (in the user's time zone).
- to - date/time. End date of the interval - when the specified location has to be visited (in the user's time zone).
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/create' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task": {"tracker_id": 22, "location": {"lat": 56.83717295, "lng": 60.59761920, "radius": 150}, "label": "Name", "description": "Description example", "from": "2020-02-03 04:05:06", "to": "2020-03-04 05:06:07"}, "create_form": false}'
task/create call returns the identifier of the created task. A returned object also can include "external_id_counts" field see task/route/create method description.
response
{
"success": true,
"id": 111,
"external_id_counts": [{
"external_id": "456",
"count": 2
}]
}
- id - int. An id of the created task.
Note: The "id" parameter is unique, it is automatically generated by the server when you create a task. Therefore, if you call task/create two times with the same parameters, every time the new task will be created. These two tasks will differ only by an id. Respectively, if the created task has to be connected to a certain record in external system, you have to remember the id of this record to use it in future when you want to change/delete the associated task in our system.
errors:
- 201 - Not found in the database (if task.tracker_id is not null and belongs to nonexistent tracker).
- 236 - Feature unavailable due to tariff restrictions (if device's tariff does not allow usage of tasks).
delete
Deletes the task with the specified id.
required sub-user rights: task_update.
parameters:
name | description | type |
task_id | Id of the task to delete. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/delete' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task_id": 23144}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database (if there is no task with such an id).
list
Gets all task belonging to user with optional filtering.
parameters:
name | description | type |
external_id | Optional. External task ID for search. | string |
statuses | Optional. Default all. List of task statuses, e.g. ["unassigned","failed"]. | string arraj |
trackers | Optional. Ids of the trackers to which task assigned. | int array |
from | Optional. Show tasks which are actual AFTER this date, e.g. "2020-07-01 00:00:00". | date/time |
to | Optional. Show tasks which are actual BEFORE this date, e.g. "2020-07-01 00:00:00". | date/time |
conditions | Optional. Search conditions to apply to list. Array of search conditions. | array of SearchCondition |
filter | Optional. Filter for all built-in and custom fields. If used with conditions, both filter and conditions must match for every returned task. | string |
filters | Optional. Filters for task label, description or address. | string array |
tag_ids | Optional. Tag IDs assigned to the task. | int array |
location | Optional. Location with radius, inside which task zone centers must reside. Example: { "lat": 56.823777, "lng": 60.594164, "radius": 350 } | Location JSON |
offset | Optional. Offset from start of the found tasks for pagination. | int |
limit | Optional. Limit of the found tasks for pagination. | int |
CONDITION FIELDS:
Name | Type | Comment |
id | number | |
employee | number | id |
status | string | |
label | string | |
location | string | address |
from | date/time | |
to | date/time | |
status_change_date | date/time | |
arrival_date | date/time | |
stay_duration | Seconds | |
description | string | |
external_id | string | |
form | number | template's id |
If external_id, trackers, filters, from, to or tag_ids is not passed or null then appropriate condition not used to filter results.
If offset or limit is null then restrictions for pagination will not be applied.
SORT:STRING
set of sort options. Each option is a pair of column name and sorting direction, e.g. ["label=acs", "address=desc", "employee=desc"].
SORT FIELDS
Name | Type | Comment |
id | number | |
employee | string | full name or tracker label |
status | string | |
label | string | |
location | string | address |
from | date/time | |
to | date/time | |
status_change_date | date/time | |
arrival_date | date/time | |
stay_duration | Seconds | |
description | string | |
external_id | string | |
form | string | label |
If external_id, trackers, filters, from, to or tag_ids is not passed or null then appropriate condition not used to filter results.
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/list' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b"}'
response
{
"success": true,
"list": [{
"id": 111,
"user_id": 3,
"tracker_id": 22,
"location": {
"lat": 56.5,
"lng": 60.5,
"address": "Schulhof 2, Wien, Austria",
"radius": 150
}
"label": "Name",
"description": "Description example",
"creation_date": "2014-01-02 03:04:05",
"from": "2020-02-03 04:05:06",
"to": "2020-03-04 05:06:07",
"external_id": "01234567",
"status": "assigned",
"status_change_date": "2020-01-02 03:04:05",
"max_delay": 5,
"min_stay_duration": 0,
"arrival_date": "2020-01-02 03:04:05",
"stay_duration": 10,
"origin": "manual",
"type": "task"
}]
"count": 1
}
- list - array of task objects.
- id - int. Task id.
- user_id - int. User id (office). An unchangeable parameter.
- tracker_id - int. Tracker ID. Indicator ID by which the implementation of this task will be controlled.
- location - area (circle geofence), entering and leaving of geofence will be controlled.
- label - string. Task name, length 1-200 characters.
- description - string. Task description, length 0-1024 characters.
- creation_date - date/time. Date of creation of a task, unchangeable field.
- from - date/time. Start date of the interval - when the specified location has to be visited (in the user's time zone).
- to - date/time. End date of the interval - when the specified location has to be visited (in the user's time zone).
- external_id - string. Text field for tracking of communication of the task with certain external systems (for example, number of the order). Is for reference only.
- status - enum. Current status of a task, can have "unassigned" value (unassigned to any executor), "assigned", "done", "failed", "delayed", "arrived" (arrived to geofence but haven't done the task), "faulty" (with problems).
- status_change_date - date/time. Date of the last change of the status of a task.
- max_delay - int. The maximum time delay of the execution of the task, in minutes.
- min_stay_duration - int. The minimum stay time in the area of the task in which the task has to be done, in minutes.
- arrival_date - date/time. Date and time of arrival in the area of the task. Can be null. If the executor has not visited it yet.
- stay_duration - int. Number of seconds spent inside task zone.
- origin - enum. The way of creation of a task. Can be "manual", "scheduled" or "imported" (from excel).
- type - string. Reserved.
- count - int. count of the all found tasks.
read
Gets task, checkpoint, or route with checkpoints by specified id.
parameters:
name | description | type |
task_id | Id of the task, route or checkpoint. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/read' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task_id": 23144}'
response
{
"success": true,
"value": 'task or checkpoint or route',
"checkpoints": [
'checkpoint1',
'checkpoint2'
]
}
- value - JSON object.
- checkpoints - only returned if entity with specified id is a route. Contains all checkpoints of this route.
errors:
- 201 - Not found in the database (if there is no task with such an id).
transmute
Converts task into a route checkpoint.
required sub-user rights: task_update.
parameters:
name | description | type |
task_id | Id of the task to convert. | int |
route_id | Id of the route to attach to. | int |
order | Zero-based index at which checkpoint should be inserted into route. | int |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/transmute' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task_id": 23144, "route_id": 12334, "order": 0}'
response
{
"success": true,
}
errors:
- 201 - Not found in the database (if there is no task or route with such an id, or tracker to which checkpoint assigned is unavailable to current sub-user).
- 255 - Invalid task state (if task or any of the checkpoints are not in unassigned or assigned state).
update
Updates existing task. Note that you cannot change task owner using this method.
required sub-user rights: task_update.
parameters:
name | description | type |
task | task object without fields which are IGNORED. | JSON object |
create_form | If true then check additional form_template_id field in task object and create, replace or delete task's form. Default value is false for backward compatibility. | boolean |
Example:
'cURL'
curl -X POST 'https://api.itrack.live/task/update' \
-H 'Content-Type: application/json' \
-d '{"hash": "22eac1c27af4be7b9d04da2ce1af111b", "task": {"id": 22379, "location": {"lat": 56.83717295, "lng": 60.59761920, "radius": 150}, "label": "Name", "description": "Description example", "from": "2020-02-03 04:05:06", "to": "2020-03-04 05:06:07"}, "create_form": false}'
A returned object also can include "external_id_counts" field see task/route/create method description.
response
{
"success": true,
"external_id_counts": [{
"external_id": "456",
"count": 2
}]
}
errors:
- 201 - Not found in the database (if there is no task with such an id).
- 255 - Invalid task state (if current task state is not "unassigned" or "assigned").
If you have more questions please contact our support team