Xtrack API Details

User Account Related APIs

1. LIST DEVICES

Description: This API is used for listing details of all devices owned by user.
EndPoint: https://api.xtrack.io/xtrack/list
Request Method: GET

  Parameters:
    e=demo@xtrack.io //User's email which was used to sign up on my.xtrack.io
    p=API_KEY //User's API KEY obtained from my.xtrack.io

  Response:
    Response is a JSON Array as following:
    {"status":"ok","data":[{"id":"23","imei_name":"866710032471234","owner":"2","password":"aBcD","name":"Ricky","freq":"10","tz":"Asia\/Kolkata",
    "country":"IN","phone":"9876543210","apn":"www","apn_user":"","apn_pass":"","P1":"","P2":"","P3":"200001","P4":"","P5":"200001","P6":"","P7":"",
    "smart":"1","history":"1","configed":"1","configts":null,"activetill":"2017-12-25 12:34:33","o1":"0","o2":"0","o3":"0","o4":"0","o5":"0","o6":"0",
    "o7":"0","lastonts":null,"laston_lon":"0.0000000000","laston_lat":"0.0000000000","lastoffts":null,"lastoff_lon":"0.0000000000",
    "lastoff_lat":"0.0000000000","lastspeedts":null,"lastspeed":"0.0000","lastengine":"0"}]}
    status member is "ok" on each successfull query.In the event of an exception status is of the format "error: ERROR_MESSAGE".
    data member contains JSON array of details of each device owned by the caller.

2. Acquire Device

Description: This Endpoint is used to acquire a fresh device which is not owned by anybody else.
EndPoint: https://api.xtrack.io/xtrack/acquire
Request Method: GET

  Parameters:
    e=demo@xtrack.io //User's email which was used to sign up on my.xtrack.io
    p=API_KEY //User's API KEY obtained from my.xtrack.io
    i=IMEI //15 digit IMEI number of device printed inside the cover of device
    pp=PASSWORD //4 Character Device Password printed inside the cover of device
  Response:
    Response is a JSON Array as following:
    {"status":"ok"} or {"status":"error: ERROR_MESSAGE"}

Device Specific APIs

1. Rename Device

Description: This Endpoint is used to rename an Xtrack device
EndPoint: https://api.xtrack.io/xtrack/rename
Request Method: GET

  Parameters:
    i=IMEI //15 digit IMEI number of device printed inside the cover of device
    p=API_KEY //User's API KEY obtained from my.xtrack.io
    n=NAME //New name of Device, upto 20 characters long alpha-numeric only
  Response:

    Response is a JSON Array as following:
    {"status":"ok"} or {"status":"error: ERROR_MESSAGE"}

2. Configure Device

Description: This Endpoint is used to configure an Xtrack device.It should be called only after inserting SIM card and at least 1 minute of running so that device can receive can receive configuration message sent by our server.
EndPoint: https://api.xtrack.io/xtrack/configure
Request Method: GET

  Parameters:
    i=IMEI //15 digit IMEI of Device printed inside the cover of device
    p=API_KEY //User's API KEY obtained from my.xtrack.io
    freq=10 //Interval at which device should send pulses
    tz=Asia/Kolkata //Currently only Asia/Kolkata is allowed
    phone=9876543210 //10-digit phone number of the SIM inserted in device
    apn=www //Network Specific APN, www for Airtel, internet for idea etc.
    apn_user=XXX //APN Username, Blank for most Indian telecom networks
    apn_pass=YYY //APN Password, Blank for most Indian telecom networks
    history=1 //Number of days for which pulse data of device to be preserved;upto 1 day of history is free of cost, beyond 1 day is chargeable
    smart=1 //Smart filter 1=on, 0=off When you connect Ignition detection module on Port 3, Xtrack sends data faster when Ignition is on and vice-versa; which saves a lot of device's Data
    p1=100001 //Serial Number of Module attached to Port 1 of device
    p2=100001 //Serial Number of Module attached to Port 2 of device
    p3=200001 //Serial Number of Module attached to Port 3 of device
    p4=100001 //Serial Number of Module attached to Port 4 of device
    p5=200001 //Serial Number of Module attached to Port 5 of device
    p6=100001 //Serial Number of Module attached to Port 6 of device
    p7=100001 //Serial Number of Module attached to Port 7 of device
**** Port 3 is reserved for Smart-Filter(Ignition Detection) and Port 5 is reserved for AC status detection module. So p3 and p5 should be 200001 in above query.
  Response:
    Response is a JSON Array as following:
    {"status":"ok"} or {"status":"error: ERROR_MESSAGE"}

3. Get Device Pulse Data

Description: Xtrack device periodically send data to server.THis API is used to access the data sent by device.
This endpoint allows you to fetch gps points sent by your device.Post Parameters "i" and "p" are used to establish authenticity of the requester.
Both of these details can be obtained by going to Settings section after selecting the device in your MyXtrack Account at http://my.xtrack.io
EndPoint: https://api.xtrack.io/xtrack/gps
Request Method: POST

  Parameters:
    s=w //This is a mandatory hardocded parameter with value w.
    a= //"YYYY-MM-DD HH:MM:SS AM" format Timestamp from which you want to fetch datapoints.If this is left blank, datapoints from a 24 hours period ending at end_date shall be fetched.
    b= //"YYYY-MM-DD HH:MM:SS AM" format Timestamp upto which you want to fetch datapoints.This can be left blank for Current time
    i=865209030934054 //15 Digit IMEI of your Xtrack device
    p=API_KEY //USER's API Key
    tz=Asia/Kolkata //The Time zone for your request.Use "Asia/Kolkata" for Indian Standard Time
  Optional Parameters:
    l=1 //This parameter can be used to limit data points.For Example l=1 fetches only last valid data point during the given timerange.
  Response:
    Response is a JSON array of Datapoints.A Sample Response having Two Data Points is as following:
    [
      ["2017-09-16 03:41:24 PM","77.089564","28.687912","209.768982","18.646362","-0.000009","93.813171","3.375015","1.318343","3.106879","0","329187","1","0","0","0","{21,67,357,29:18,57,311,22:15,48,50,42:20,33,52,35:10,33,277,28:29,33,172,31:4,25,310,32:24,22,121,22:13,17,40,28:27,14,320,32:16,5,285,26:26,4,259,10:40,0,0,31:41,0,0,39:193,0,0,27:}","{21,67,357,29:15,48,50,42:18,57,311,22:10,33,277,28:29,33,172,31:20,33,52,35:}"],       ["2017-09-16 03:42:58 PM","77.091620","28.687829","216.423996","11.085451","-0.000498","95.758087","2.168878","1.091433","1.874248","0","423207","1","0","0","0","{21,67,358,30:18,57,312,29:15,47,49,40:10,34,277,32:20,33,52,35:29,32,172,30:4,25,309,32:24,22,121,22:13,16,40,12:27,15,319,21:40,0,0,31:41,0,0,40:193,0,0,30:}","{21,67,358,30:15,47,49,40:18,57,312,29:10,34,277,32:29,32,172,30:27,15,319,21:20,33,52,35:}"]     ]
    Every Individual Data Point is a non-Associative Array of Strings described as following:
    [0] -> TimeStamp of the Point
    [1] -> Longitude
    [2] -> Latitude
    [3] -> Altitude
    [4] -> Horizontal Speed in miles per hour
    //For Most of the user Only the Above 5 Values are useful.Values below are only for advanced users.
    [5] -> Vertical Speed in miles per hour
    [6] -> Movement Direction in Degrees
    [7] -> PDOP
    [8] -> HDOP
    [9] -> VDOP
    [10] -> MSOFFSET
    [11] -> MS
    [12] -> Power Mode 1: Main Supply or 0:Battery
    [13] -> 1: Cached Value 2: Real Value
    [14] -> IMASK
    [15] -> Y
    [16] -> Satellites In View
    [17] -> Used Satellites