Platform API

<back to all web services

RegisterDevice

Saves/Updates a Devices details and registers that device with an appliance.

Requires Authentication
import java.math.*
import java.util.*
import java.io.InputStream
import net.servicestack.client.*


/**
* Saves/Updates a Devices details and registers that device with an appliance.
*/
@Api(Description="Saves/Updates a Devices details and registers that device with an appliance.")
open class RegisterDevice
{
    /**
    * Guid of the Appliance this Device is Registering under.
    */
    @ApiMember(DataType="Guid", Description="Guid of the Appliance this Device is Registering under.", IsRequired=true, Name="ApplianceId", ParameterType="query")
    open var ApplianceId:UUID? = null

    /**
    * Guid of the Device. If empty the Device will be inserted, if provided the device will be updated.
    */
    @ApiMember(DataType="Guid", Description="Guid of the Device. If empty the Device will be inserted, if provided the device will be updated.", IsRequired=true, Name="DeviceId", ParameterType="query")
    open var DeviceId:UUID? = null

    /**
    * The Device manufacturers number.
    */
    @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
    open var ManufacturerDeviceNumber:String? = null

    /**
    * The Device MAC Address.
    */
    @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
    open var MacAddress:String? = null

    /**
    * The Device Model Name.
    */
    @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
    open var ModelName:String? = null

    /**
    * The Device Form, e.g Phone | Tablet.
    */
    @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", IsRequired=true, Name="FormFactor", ParameterType="query")
    open var FormFactor:String? = null

    /**
    * The Device Brand.
    */
    @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
    open var Brand:String? = null

    /**
    * The Device Dimensions (Height x Width x Depth).
    */
    @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
    open var Dimensions:String? = null

    /**
    * The Device display resolution width in pixels.
    */
    @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
    open var DisplayResolutionWidthPixels:Int? = null

    /**
    * The Device display resolution height in pixels.
    */
    @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
    open var DisplayResolutionHeightPixels:Int? = null

    /**
    * The Device display width size in inches.
    */
    @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
    open var DisplaySizeWidthInches:BigDecimal? = null

    /**
    * The Device display height size in inches.
    */
    @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
    open var DisplaySizeHeightInches:BigDecimal? = null

    /**
    * The Device operating system.
    */
    @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
    open var OperatingSystem:String? = null

    /**
    * The Device operating system version.
    */
    @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
    open var OperatingSystemVersion:String? = null

    /**
    * The Device IP Address.
    */
    @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
    open var IpAddress:String? = null

    /**
    * Any Notes about the device.
    */
    @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
    open var Notes:String? = null

    /**
    * Total memory size available (in bytes).
    */
    @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
    open var TotalMemorySize:Int? = null

    /**
    * The Network provider name.
    */
    @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
    open var CellularProviderName:String? = null

    /**
    * The ISO Country Code of the country the device is currently located in.
    */
    @ApiMember(DataType="string", Description="The ISO Country Code of the country the device is currently located in.", Name="ISOCountryCode", ParameterType="query")
    open var ISOCountryCode:String? = null

    /**
    * The Mobile Country Code the device is currently located in.
    */
    @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
    open var MobileCountryCode:String? = null

    /**
    * The Mobile Network Code the device is currently using.
    */
    @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
    open var MobileNetworkCode:String? = null

    /**
    * The Language Code Identifier that represents the language used on the device.
    */
    @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
    open var LanguageCodeIdentifier:String? = null

    /**
    * The name of the Timezone the device was last used in.
    */
    @ApiMember(DataType="string", Description="The name of the Timezone the device was last used in.", Name="LastKnownTimeZone", ParameterType="query")
    open var LastKnownTimeZone:String? = null

    /**
    * The UTC Offset of the Timezone the device was last used in.  Formatted as +-##:##
    */
    @ApiMember(DataType="string", Description="The UTC Offset of the Timezone the device was last used in.  Formatted as +-##:##", Name="LastKnownTimeZoneOffset", ParameterType="query")
    open var LastKnownTimeZoneOffset:String? = null

    /**
    * The latitude the device was last located at.
    */
    @ApiMember(DataType="double", Description="The latitude the device was last located at.", IsRequired=true, Name="Latitude", ParameterType="query")
    open var Latitude:Double? = null

    /**
    * The longitude the device was last located at.
    */
    @ApiMember(DataType="double", Description="The longitude the device was last located at.", IsRequired=true, Name="Longitude", ParameterType="query")
    open var Longitude:Double? = null

    /**
    * The current value of InstanceSeed that the device has stored.
    */
    @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
    open var InstanceSeed:Int? = null

    /**
    * The current value of InstanceCounterLastValue that the device has stored
    */
    @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
    open var InstanceCounterLastValue:Int? = null
}

open class DeviceModel
{
    /**
    * Guid representing the saved Device
    */
    @ApiMember(DataType="Guid", Description="Guid representing the saved Device", Name="DeviceId", ParameterType="query")
    open var DeviceId:UUID? = null

    /**
    * Details of the Type of Device
    */
    @ApiMember(DataType="DeviceTypeModel", Description="Details of the Type of Device", Name="DeviceType", ParameterType="query")
    open var DeviceType:DeviceTypeModel? = null

    /**
    * Current saved settings of the Device
    */
    @ApiMember(DataType="DeviceHistoryModel", Description="Current saved settings of the Device", Name="CurrentHistory", ParameterType="query")
    open var CurrentHistory:DeviceHistoryModel? = null

    /**
    * The Device Model Name.
    */
    @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
    open var ModelName:String? = null

    /**
    * The Device model number.
    */
    @ApiMember(DataType="string", Description="The Device model number.", Name="ModelNumber", ParameterType="query")
    open var ModelNumber:String? = null

    /**
    * The Device serial number.
    */
    @ApiMember(DataType="string", Description="The Device serial number.", Name="SerialNumber", ParameterType="query")
    open var SerialNumber:String? = null

    /**
    * The Device manufacturers number.
    */
    @ApiMember(DataType="string", Description="The Device manufacturers number.", Name="ManufacturerDeviceNumber", ParameterType="query")
    open var ManufacturerDeviceNumber:String? = null

    /**
    * The Device MAC Address.
    */
    @ApiMember(DataType="string", Description="The Device MAC Address.", Name="MacAddress", ParameterType="query")
    open var MacAddress:String? = null

    /**
    * The current value of InstanceSeed that the device has stored.  If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device.
    */
    @ApiMember(DataType="int", Description="The current value of InstanceSeed that the device has stored.  If InstanceCounterLastValue has gone over 99999, this will contain a new seed value for the device.", IsRequired=true, Name="InstanceSeed", ParameterType="query")
    open var InstanceSeed:Int? = null

    /**
    * The current value of InstanceCounterLastValue that the device has stored
    */
    @ApiMember(DataType="int", Description="The current value of InstanceCounterLastValue that the device has stored", IsRequired=true, Name="InstanceCounterLastValue", ParameterType="query")
    open var InstanceCounterLastValue:Int? = null

    /**
    * ServiceStack ResponseStatus.
    */
    @ApiMember(DataType="ResponseStatus", Description="ServiceStack ResponseStatus.", Name="ResponseStatus", ParameterType="query")
    open var ResponseStatus:ResponseStatus? = null
}

open class DeviceTypeModel
{
    /**
    * Guid representing the saved Device Type
    */
    @ApiMember(DataType="Guid", Description="Guid representing the saved Device Type", Name="DeviceTypeId", ParameterType="query")
    open var DeviceTypeId:UUID? = null

    /**
    * Guid representing the saved Device Class
    */
    @ApiMember(DataType="Guid", Description="Guid representing the saved Device Class", Name="DeviceClassId", ParameterType="query")
    open var DeviceClassId:UUID? = null

    /**
    * The Device Class Name
    */
    @ApiMember(DataType="string", Description="The Device Class Name", Name="DeviceClassName", ParameterType="query")
    open var DeviceClassName:String? = null

    /**
    * The Device Brand.
    */
    @ApiMember(DataType="string", Description="The Device Brand.", Name="Brand", ParameterType="query")
    open var Brand:String? = null

    /**
    * The Device Model Name.
    */
    @ApiMember(DataType="string", Description="The Device Model Name.", IsRequired=true, Name="ModelName", ParameterType="query")
    open var ModelName:String? = null

    /**
    * The Device Form, e.g Phone | Tablet.
    */
    @ApiMember(DataType="string", Description="The Device Form, e.g Phone | Tablet.", Name="FormFactor", ParameterType="query")
    open var FormFactor:String? = null

    /**
    * The Device Dimensions (Height x Width x Depth).
    */
    @ApiMember(DataType="string", Description="The Device Dimensions (Height x Width x Depth).", Name="Dimensions", ParameterType="query")
    open var Dimensions:String? = null

    /**
    * The Device display resolution width in pixels.
    */
    @ApiMember(DataType="int", Description="The Device display resolution width in pixels.", Name="DisplayResolutionWidthPixels", ParameterType="query")
    open var DisplayResolutionWidthPixels:Int? = null

    /**
    * The Device display resolution height in pixels.
    */
    @ApiMember(DataType="int", Description="The Device display resolution height in pixels.", Name="DisplayResolutionHeightPixels", ParameterType="query")
    open var DisplayResolutionHeightPixels:Int? = null

    /**
    * The Device display width size in inches.
    */
    @ApiMember(DataType="decimal", Description="The Device display width size in inches.", Name="DisplaySizeWidthInches", ParameterType="query")
    open var DisplaySizeWidthInches:BigDecimal? = null

    /**
    * The Device display height size in inches.
    */
    @ApiMember(DataType="decimal", Description="The Device display height size in inches.", Name="DisplaySizeHeightInches", ParameterType="query")
    open var DisplaySizeHeightInches:BigDecimal? = null
}

open class DeviceHistoryModel
{
    /**
    * Guid representing the current Device History
    */
    @ApiMember(DataType="Guid", Description="Guid representing the current Device History", Name="DeviceHistoryId", ParameterType="query")
    open var DeviceHistoryId:UUID? = null

    /**
    * Guid representing the current Device History Device Configuration record.
    */
    @ApiMember(DataType="Guid", Description="Guid representing the current Device History Device Configuration record.", Name="PrimaryDeviceHistoryDeviceConfigurationId", ParameterType="query")
    open var PrimaryDeviceHistoryDeviceConfigurationId:UUID? = null

    /**
    * The Device name.
    */
    @ApiMember(DataType="string", Description="The Device name.", Name="DeviceName", ParameterType="query")
    open var DeviceName:String? = null

    /**
    * The Device operating system.
    */
    @ApiMember(DataType="string", Description="The Device operating system.", Name="OperatingSystem", ParameterType="query")
    open var OperatingSystem:String? = null

    /**
    * The Device operating system version.
    */
    @ApiMember(DataType="string", Description="The Device operating system version.", Name="OperatingSystemVersion", ParameterType="query")
    open var OperatingSystemVersion:String? = null

    /**
    * The Device IP Address.
    */
    @ApiMember(DataType="string", Description="The Device IP Address.", Name="IpAddress", ParameterType="query")
    open var IpAddress:String? = null

    /**
    * Any Notes about the device.
    */
    @ApiMember(DataType="string", Description="Any Notes about the device.", Name="Notes", ParameterType="query")
    open var Notes:String? = null

    /**
    * Total memory size available (in bytes).
    */
    @ApiMember(DataType="string", Description="Total memory size available (in bytes).", Name="TotalMemorySize", ParameterType="query")
    open var TotalMemorySize:Int? = null

    /**
    * The Network provider name.
    */
    @ApiMember(DataType="string", Description="The Network provider name.", Name="CellularProviderName", ParameterType="query")
    open var CellularProviderName:String? = null

    /**
    * The Mobile Country Code the device is currently located in.
    */
    @ApiMember(DataType="string", Description="The Mobile Country Code the device is currently located in.", Name="MobileCountryCode", ParameterType="query")
    open var MobileCountryCode:String? = null

    /**
    * The Mobile Network Code the device is currently using.
    */
    @ApiMember(DataType="string", Description="The Mobile Network Code the device is currently using.", Name="MobileNetworkCode", ParameterType="query")
    open var MobileNetworkCode:String? = null

    /**
    * The Language Code Identifier that represents the language used on the device.
    */
    @ApiMember(DataType="string", Description="The Language Code Identifier that represents the language used on the device.", Name="LanguageCodeIdentifier", ParameterType="query")
    open var LanguageCodeIdentifier:String? = null

    /**
    * The latitude the device was last located at.
    */
    @ApiMember(DataType="double", Description="The latitude the device was last located at.", Name="Latitude", ParameterType="query")
    open var Latitude:Double? = null

    /**
    * The longitude the device was last located at.
    */
    @ApiMember(DataType="double", Description="The longitude the device was last located at.", Name="Longitude", ParameterType="query")
    open var Longitude:Double? = null
}

Kotlin RegisterDevice 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/RegisterDevice HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	ManufacturerDeviceNumber: String,
	MacAddress: String,
	ModelName: String,
	FormFactor: String,
	Brand: String,
	Dimensions: String,
	DisplayResolutionWidthPixels: 0,
	DisplayResolutionHeightPixels: 0,
	DisplaySizeWidthInches: 0,
	DisplaySizeHeightInches: 0,
	OperatingSystem: String,
	OperatingSystemVersion: String,
	IpAddress: String,
	Notes: String,
	TotalMemorySize: 0,
	CellularProviderName: String,
	ISOCountryCode: String,
	MobileCountryCode: String,
	MobileNetworkCode: String,
	LanguageCodeIdentifier: String,
	LastKnownTimeZone: String,
	LastKnownTimeZoneOffset: String,
	Latitude: 0,
	Longitude: 0,
	InstanceSeed: 0,
	InstanceCounterLastValue: 0
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	DeviceType: 
	{
		DeviceClassName: String,
		Brand: String,
		ModelName: String,
		FormFactor: String,
		Dimensions: String,
		DisplayResolutionWidthPixels: 0,
		DisplayResolutionHeightPixels: 0,
		DisplaySizeWidthInches: 0,
		DisplaySizeHeightInches: 0
	},
	CurrentHistory: 
	{
		DeviceName: String,
		OperatingSystem: String,
		OperatingSystemVersion: String,
		IpAddress: String,
		Notes: String,
		TotalMemorySize: 0,
		CellularProviderName: String,
		MobileCountryCode: String,
		MobileNetworkCode: String,
		LanguageCodeIdentifier: String,
		Latitude: 0,
		Longitude: 0
	},
	ModelName: String,
	ModelNumber: String,
	SerialNumber: String,
	ManufacturerDeviceNumber: String,
	MacAddress: String,
	InstanceSeed: 0,
	InstanceCounterLastValue: 0,
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}