GET POST | /report/keyhistory |
---|
"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 KeyHistory {
/** @param {{unitId?:string,time?:string,location?:Location,address?:Address,heading?:number,speed?:number,km?:number,run1?:number,run2?:number,runOdo?:number,temperature1?:number,temperature2?:number,input1?:boolean,input2?:boolean,output3?:boolean,batteryLevel?:number,externalPower?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
unitId;
/** @type {string} */
time;
/** @type {Location} */
location;
/** @type {Address} */
address;
/** @type {?number} */
heading;
/** @type {?number} */
speed;
/** @type {?number} */
km;
/** @type {?number} */
run1;
/** @type {?number} */
run2;
/** @type {?number} */
runOdo;
/** @type {?number} */
temperature1;
/** @type {?number} */
temperature2;
/** @type {?boolean} */
input1;
/** @type {?boolean} */
input2;
/** @type {?boolean} */
output3;
/** @type {?number} */
batteryLevel;
/** @type {?number} */
externalPower;
}
export class GetReportKeyHistoryResponse {
/** @param {{list?:KeyHistory[],responseStatus?:ResponseStatus}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {KeyHistory[]} */
list;
/** @type {ResponseStatus} */
responseStatus;
}
export class GetReportKeyHistory {
/** @param {{keyId?:string,from?:string,to?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
keyId;
/** @type {?string} */
from;
/** @type {?string} */
to;
}
JavaScript GetReportKeyHistory DTOs
To override the Content-type in your clients, use the HTTP Accept Header, append the .other suffix or ?format=other
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /report/keyhistory HTTP/1.1
Host: api.trackunit.com
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length
{"keyId":"String","from":"0001-01-01T00:00:00.0000000Z","to":"0001-01-01T00:00:00.0000000Z"}
HTTP/1.1 200 OK Content-Type: text/jsonl Content-Length: length {"list":[{"unitId":"String","time":"0001-01-01T00:00:00.0000000Z","location":{"latitude":0,"longitude":0},"address":{"country":"String","zipCode":"String","city":"String","streetAddress":"String"},"heading":0,"speed":0,"km":0,"run1":0,"run2":0,"runOdo":0,"temperature1":0,"temperature2":0,"input1":false,"input2":false,"output3":false,"batteryLevel":0,"externalPower":0}],"responseStatus":{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}}