Platform API

<back to all web services

LogDeviceStatuses

Logs multiple device event details. Details include an event(crash,error,unexpected result) and the device status at the time of the event.

Requires Authentication
"use strict";
export class LogDeviceStatus {
    /** @param {{ApplianceId?:string,DeviceId?:string,Latitude?:number,Longitude?:number,EventName?:string,EventDetail1?:string,EventDetail2?:string,EventDetail3?:string,EventDetail4?:string,EventDetail5?:string,Orientation?:string,InternetConnectionStatus?:string,Log?:string,Event?:string,IsInPortrait?:boolean,IsInLandscape?:boolean,CellularDataEnabled?:boolean,DataRoamingEnabled?:boolean,IsNetworkAvailable?:boolean,CanSendSMS?:boolean,BatteryCharging?:boolean,BatteryLevel?:number,MediaFileId1?:string,MediaFileId2?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Guid of the Appliance this Device is logging an event status for. */
    ApplianceId;
    /**
     * @type {string}
     * @description Guid representing the saved Device */
    DeviceId;
    /**
     * @type {number}
     * @description The latitude the device was last located at. */
    Latitude;
    /**
     * @type {number}
     * @description The longitude the device was last located at. */
    Longitude;
    /**
     * @type {string}
     * @description Name of the event we're logging. */
    EventName;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    EventDetail1;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    EventDetail2;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    EventDetail3;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    EventDetail4;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    EventDetail5;
    /**
     * @type {string}
     * @description Details of the event up to (255 char). */
    Orientation;
    /**
     * @type {string}
     * @description The device internet connection status. */
    InternetConnectionStatus;
    /**
     * @type {string}
     * @description Unlimited text field for logging details of the event. */
    Log;
    /**
     * @type {string}
     * @description Date and Time of the event. */
    Event;
    /**
     * @type {boolean}
     * @description True if the device is in portrait mode. */
    IsInPortrait;
    /**
     * @type {boolean}
     * @description True if the device is in landscape mode. */
    IsInLandscape;
    /**
     * @type {boolean}
     * @description True if cellular data is enabled. */
    CellularDataEnabled;
    /**
     * @type {boolean}
     * @description True if data roaming is enabled. */
    DataRoamingEnabled;
    /**
     * @type {boolean}
     * @description True if the network is available. */
    IsNetworkAvailable;
    /**
     * @type {boolean}
     * @description True if the device can send an sms. */
    CanSendSMS;
    /**
     * @type {boolean}
     * @description True if the battery is charging. */
    BatteryCharging;
    /**
     * @type {number}
     * @description The amount of battery life left as a percentage. */
    BatteryLevel;
    /**
     * @type {string}
     * @description The Guid of a saved Media Object. */
    MediaFileId1;
    /**
     * @type {string}
     * @description The Guid of a saved Media Object. */
    MediaFileId2;
}
export class LogDeviceStatuses {
    /** @param {{DeviceStatuses?:LogDeviceStatus[]}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {LogDeviceStatus[]}
     * @description A list of logged event statuses for a device. */
    DeviceStatuses = [];
}

JavaScript LogDeviceStatuses DTOs

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

HTTP + JSV

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

POST /jsv/reply/LogDeviceStatuses HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	DeviceStatuses: 
	[
		{
			Latitude: 0,
			Longitude: 0,
			EventName: String,
			EventDetail1: String,
			EventDetail2: String,
			EventDetail3: String,
			EventDetail4: String,
			EventDetail5: String,
			Orientation: String,
			InternetConnectionStatus: String,
			Log: String,
			Event: 0001-01-01,
			IsInPortrait: False,
			IsInLandscape: False,
			CellularDataEnabled: False,
			DataRoamingEnabled: False,
			IsNetworkAvailable: False,
			CanSendSMS: False,
			BatteryCharging: False,
			BatteryLevel: 0
		}
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ErrorCode: String,
	Message: String,
	StackTrace: String,
	Errors: 
	[
		{
			ErrorCode: String,
			FieldName: String,
			Message: String,
			Meta: 
			{
				String: String
			}
		}
	],
	Meta: 
	{
		String: String
	}
}