Trackunit API

<back to all web services

GetUnit

The following routes are available for this service:
GET/unit
GET/unit/{Id}
GET POST/GetUnit
GET POST/GetUnit/{Id}
"use strict";
export class Location {
    /** @param {{latitude?:number,longitude?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    latitude;
    /** @type {number} */
    longitude;
}
export class Address {
    /** @param {{country?:string,zipCode?:string,city?:string,streetAddress?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    country;
    /** @type {string} */
    zipCode;
    /** @type {string} */
    city;
    /** @type {string} */
    streetAddress;
}
export class Unit {
    /** @param {{id?:string,serialNumber?:string,phoneNumber?:string,vehicleType?:string,deviceType?:string,deviceModel?:string,name?:string,displayName?:string,referenceNumber?:string,note?:string,createdAt?:string,input1Name?:string,input2Name?:string,input3Name?:string,input4Name?:string,categoryId?:string,clientId?:string,gpsFixTime?:string,messageTime?:string,location?:Location,altitude?:number,heading?:number,speed?:number,address?:Address,temperature1?:number,temperature2?:number,gsmLevel?:number,gsmSignalQuality?:string,gpsSignalQuality?:string,batteryLevel?:number,externalPower?:number,preRun1?:number,preRun2?:number,run1?:number,run2?:number,run3?:number,run4?:number,runOdo?:number,preKm?:number,km?:number,input1?:boolean,input2?:boolean,input3?:boolean,input4?:boolean,input5?:boolean,input6?:boolean,input7?:boolean,input8?:boolean,input9?:boolean,input10?:boolean,output1?:boolean,output2?:boolean,output3?:boolean,output4?:boolean,output5?:boolean,analogInput1?:number,analogInput2?:number,analogInput4?:number,input1ChangeCounter?:number,input2ChangeCounter?:number,input3ChangeCounter?:number,input4ChangeCounter?:number,isActive?:boolean,keyId?:string,isOwn?:boolean,currentStop?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    serialNumber;
    /** @type {string} */
    phoneNumber;
    /** @type {string} */
    vehicleType;
    /** @type {string} */
    deviceType;
    /** @type {string} */
    deviceModel;
    /** @type {string} */
    name;
    /** @type {string} */
    displayName;
    /** @type {string} */
    referenceNumber;
    /** @type {string} */
    note;
    /** @type {string} */
    createdAt;
    /** @type {string} */
    input1Name;
    /** @type {string} */
    input2Name;
    /** @type {string} */
    input3Name;
    /** @type {string} */
    input4Name;
    /** @type {string} */
    categoryId;
    /** @type {string} */
    clientId;
    /** @type {?string} */
    gpsFixTime;
    /** @type {?string} */
    messageTime;
    /** @type {Location} */
    location;
    /** @type {?number} */
    altitude;
    /** @type {?number} */
    heading;
    /** @type {?number} */
    speed;
    /** @type {Address} */
    address;
    /** @type {?number} */
    temperature1;
    /** @type {?number} */
    temperature2;
    /** @type {?number} */
    gsmLevel;
    /** @type {string} */
    gsmSignalQuality;
    /** @type {string} */
    gpsSignalQuality;
    /** @type {?number} */
    batteryLevel;
    /** @type {?number} */
    externalPower;
    /** @type {number} */
    preRun1;
    /** @type {number} */
    preRun2;
    /** @type {?number} */
    run1;
    /** @type {?number} */
    run2;
    /** @type {?number} */
    run3;
    /** @type {?number} */
    run4;
    /** @type {?number} */
    runOdo;
    /** @type {number} */
    preKm;
    /** @type {?number} */
    km;
    /** @type {?boolean} */
    input1;
    /** @type {?boolean} */
    input2;
    /** @type {?boolean} */
    input3;
    /** @type {?boolean} */
    input4;
    /** @type {?boolean} */
    input5;
    /** @type {?boolean} */
    input6;
    /** @type {?boolean} */
    input7;
    /** @type {?boolean} */
    input8;
    /** @type {?boolean} */
    input9;
    /** @type {?boolean} */
    input10;
    /** @type {?boolean} */
    output1;
    /** @type {?boolean} */
    output2;
    /** @type {?boolean} */
    output3;
    /** @type {?boolean} */
    output4;
    /** @type {?boolean} */
    output5;
    /** @type {?number} */
    analogInput1;
    /** @type {?number} */
    analogInput2;
    /** @type {?number} */
    analogInput4;
    /** @type {?number} */
    input1ChangeCounter;
    /** @type {?number} */
    input2ChangeCounter;
    /** @type {?number} */
    input3ChangeCounter;
    /** @type {?number} */
    input4ChangeCounter;
    /** @type {boolean} */
    isActive;
    /** @type {string} */
    keyId;
    /** @type {boolean} */
    isOwn;
    /** @type {?number} */
    currentStop;
}
export class GetUnitResponse {
    /** @param {{list?:Unit[],responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {Unit[]} */
    list;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class GetUnit {
    /** @param {{id?:string,serialNumber?:string,referenceNumber?:string,categoryId?:string,clientId?:string,groupId?:string,zoneId?:string,pointId?:string,point?:Location,radius?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    id;
    /** @type {string} */
    serialNumber;
    /** @type {string} */
    referenceNumber;
    /** @type {string} */
    categoryId;
    /** @type {string} */
    clientId;
    /** @type {string} */
    groupId;
    /** @type {string} */
    zoneId;
    /** @type {string} */
    pointId;
    /** @type {Location} */
    point;
    /** @type {?number} */
    radius;
}

JavaScript GetUnit DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other

HTTP + OTHER

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /GetUnit HTTP/1.1 
Host: api.trackunit.com 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"id":"String","serialNumber":"String","referenceNumber":"String","categoryId":"String","clientId":"String","groupId":"String","zoneId":"String","pointId":"String","point":{"latitude":0,"longitude":0},"radius":0}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"list":[{"id":"String","serialNumber":"String","phoneNumber":"String","vehicleType":"String","deviceType":"String","deviceModel":"String","name":"String","displayName":"String","referenceNumber":"String","note":"String","createdAt":"0001-01-01T00:00:00.0000000Z","input1Name":"String","input2Name":"String","input3Name":"String","input4Name":"String","categoryId":"String","clientId":"String","gpsFixTime":"0001-01-01T00:00:00.0000000Z","messageTime":"0001-01-01T00:00:00.0000000Z","location":{"latitude":0,"longitude":0},"altitude":0,"heading":0,"speed":0,"address":{"country":"String","zipCode":"String","city":"String","streetAddress":"String"},"temperature1":0,"temperature2":0,"gsmLevel":0,"gsmSignalQuality":"String","gpsSignalQuality":"String","batteryLevel":0,"externalPower":0,"preRun1":0,"preRun2":0,"run1":0,"run2":0,"run3":0,"run4":0,"runOdo":0,"preKm":0,"km":0,"input1":false,"input2":false,"input3":false,"input4":false,"input5":false,"input6":false,"input7":false,"input8":false,"input9":false,"input10":false,"output1":false,"output2":false,"output3":false,"output4":false,"output5":false,"analogInput1":0,"analogInput2":0,"analogInput4":0,"input1ChangeCounter":0,"input2ChangeCounter":0,"input3ChangeCounter":0,"input4ChangeCounter":0,"isActive":false,"keyId":"String","isOwn":false,"currentStop":0}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}