Trackunit API

<back to all web services

GetReportUnitHistory

The following routes are available for this service:
GET POST/report/unithistory
"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 UnitHistory {
    /** @param {{time?:string,event?:number,keyId?:string,location?:Location,address?:Address,heading?:number,speed?:number,km?:number,run1?:number,run2?:number,run3?:number,run4?:number,runOdo?:number,temperature1?:number,temperature2?: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,batteryLevel?:number,externalPower?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    time;
    /** @type {number} */
    event;
    /** @type {string} */
    keyId;
    /** @type {Location} */
    location;
    /** @type {Address} */
    address;
    /** @type {?number} */
    heading;
    /** @type {?number} */
    speed;
    /** @type {?number} */
    km;
    /** @type {?number} */
    run1;
    /** @type {?number} */
    run2;
    /** @type {?number} */
    run3;
    /** @type {?number} */
    run4;
    /** @type {?number} */
    runOdo;
    /** @type {?number} */
    temperature1;
    /** @type {?number} */
    temperature2;
    /** @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 {?number} */
    batteryLevel;
    /** @type {?number} */
    externalPower;
}
export class GetReportUnitHistoryResponse {
    /** @param {{list?:UnitHistory[],responseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {UnitHistory[]} */
    list;
    /** @type {ResponseStatus} */
    responseStatus;
}
export class GetReportUnitHistory {
    /** @param {{unitId?:string,from?:string,to?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {string} */
    unitId;
    /** @type {?string} */
    from;
    /** @type {?string} */
    to;
}

JavaScript GetReportUnitHistory DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /report/unithistory HTTP/1.1 
Host: api.trackunit.com 
Accept: application/json
Content-Type: application/json
Content-Length: length

{"unitId":"String","from":"0001-01-01T00:00:00.0000000Z","to":"0001-01-01T00:00:00.0000000Z"}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"list":[{"time":"0001-01-01T00:00:00.0000000Z","event":0,"keyId":"String","location":{"latitude":0,"longitude":0},"address":{"country":"String","zipCode":"String","city":"String","streetAddress":"String"},"heading":0,"speed":0,"km":0,"run1":0,"run2":0,"run3":0,"run4":0,"runOdo":0,"temperature1":0,"temperature2":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,"batteryLevel":0,"externalPower":0}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}