Platform API

<back to all web services

RegisterDevice

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

Requires Authentication
"use strict";
export class DeviceTypeModel {
    /** @param {{DeviceTypeId?:string,DeviceClassId?:string,DeviceClassName?:string,Brand?:string,ModelName?:string,FormFactor?:string,Dimensions?:string,DisplayResolutionWidthPixels?:number,DisplayResolutionHeightPixels?:number,DisplaySizeWidthInches?:number,DisplaySizeHeightInches?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Guid representing the saved Device Type */
    DeviceTypeId;
    /**
     * @type {string}
     * @description Guid representing the saved Device Class */
    DeviceClassId;
    /**
     * @type {string}
     * @description The Device Class Name */
    DeviceClassName;
    /**
     * @type {string}
     * @description The Device Brand. */
    Brand;
    /**
     * @type {string}
     * @description The Device Model Name. */
    ModelName;
    /**
     * @type {string}
     * @description The Device Form, e.g Phone | Tablet. */
    FormFactor;
    /**
     * @type {string}
     * @description The Device Dimensions (Height x Width x Depth). */
    Dimensions;
    /**
     * @type {?number}
     * @description The Device display resolution width in pixels. */
    DisplayResolutionWidthPixels;
    /**
     * @type {?number}
     * @description The Device display resolution height in pixels. */
    DisplayResolutionHeightPixels;
    /**
     * @type {?number}
     * @description The Device display width size in inches. */
    DisplaySizeWidthInches;
    /**
     * @type {?number}
     * @description The Device display height size in inches. */
    DisplaySizeHeightInches;
}
export class DeviceHistoryModel {
    /** @param {{DeviceHistoryId?:string,PrimaryDeviceHistoryDeviceConfigurationId?:string,DeviceName?:string,OperatingSystem?:string,OperatingSystemVersion?:string,IpAddress?:string,Notes?:string,TotalMemorySize?:number,CellularProviderName?:string,MobileCountryCode?:string,MobileNetworkCode?:string,LanguageCodeIdentifier?:string,Latitude?:number,Longitude?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Guid representing the current Device History */
    DeviceHistoryId;
    /**
     * @type {string}
     * @description Guid representing the current Device History Device Configuration record. */
    PrimaryDeviceHistoryDeviceConfigurationId;
    /**
     * @type {string}
     * @description The Device name. */
    DeviceName;
    /**
     * @type {string}
     * @description The Device operating system. */
    OperatingSystem;
    /**
     * @type {string}
     * @description The Device operating system version. */
    OperatingSystemVersion;
    /**
     * @type {string}
     * @description The Device IP Address. */
    IpAddress;
    /**
     * @type {string}
     * @description Any Notes about the device. */
    Notes;
    /**
     * @type {?number}
     * @description Total memory size available (in bytes). */
    TotalMemorySize;
    /**
     * @type {string}
     * @description The Network provider name. */
    CellularProviderName;
    /**
     * @type {string}
     * @description The Mobile Country Code the device is currently located in. */
    MobileCountryCode;
    /**
     * @type {string}
     * @description The Mobile Network Code the device is currently using. */
    MobileNetworkCode;
    /**
     * @type {string}
     * @description The Language Code Identifier that represents the language used on the device. */
    LanguageCodeIdentifier;
    /**
     * @type {number}
     * @description The latitude the device was last located at. */
    Latitude;
    /**
     * @type {number}
     * @description The longitude the device was last located at. */
    Longitude;
}
export class DeviceModel {
    /** @param {{DeviceId?:string,DeviceType?:DeviceTypeModel,CurrentHistory?:DeviceHistoryModel,ModelName?:string,ModelNumber?:string,SerialNumber?:string,ManufacturerDeviceNumber?:string,MacAddress?:string,InstanceSeed?:number,InstanceCounterLastValue?:number,ResponseStatus?:ResponseStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Guid representing the saved Device */
    DeviceId;
    /**
     * @type {DeviceTypeModel}
     * @description Details of the Type of Device */
    DeviceType;
    /**
     * @type {DeviceHistoryModel}
     * @description Current saved settings of the Device */
    CurrentHistory;
    /**
     * @type {string}
     * @description The Device Model Name. */
    ModelName;
    /**
     * @type {string}
     * @description The Device model number. */
    ModelNumber;
    /**
     * @type {string}
     * @description The Device serial number. */
    SerialNumber;
    /**
     * @type {string}
     * @description The Device manufacturers number. */
    ManufacturerDeviceNumber;
    /**
     * @type {string}
     * @description The Device MAC Address. */
    MacAddress;
    /**
     * @type {number}
     * @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. */
    InstanceSeed;
    /**
     * @type {number}
     * @description The current value of InstanceCounterLastValue that the device has stored */
    InstanceCounterLastValue;
    /**
     * @type {ResponseStatus}
     * @description ServiceStack ResponseStatus. */
    ResponseStatus;
}
export class RegisterDevice {
    /** @param {{ApplianceId?:string,DeviceId?:string,ManufacturerDeviceNumber?:string,MacAddress?:string,ModelName?:string,FormFactor?:string,Brand?:string,Dimensions?:string,DisplayResolutionWidthPixels?:number,DisplayResolutionHeightPixels?:number,DisplaySizeWidthInches?:number,DisplaySizeHeightInches?:number,OperatingSystem?:string,OperatingSystemVersion?:string,IpAddress?:string,Notes?:string,TotalMemorySize?:number,CellularProviderName?:string,ISOCountryCode?:string,MobileCountryCode?:string,MobileNetworkCode?:string,LanguageCodeIdentifier?:string,LastKnownTimeZone?:string,LastKnownTimeZoneOffset?:string,Latitude?:number,Longitude?:number,InstanceSeed?:number,InstanceCounterLastValue?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /**
     * @type {string}
     * @description Guid of the Appliance this Device is Registering under. */
    ApplianceId;
    /**
     * @type {string}
     * @description Guid of the Device. If empty the Device will be inserted, if provided the device will be updated. */
    DeviceId;
    /**
     * @type {string}
     * @description The Device manufacturers number. */
    ManufacturerDeviceNumber;
    /**
     * @type {string}
     * @description The Device MAC Address. */
    MacAddress;
    /**
     * @type {string}
     * @description The Device Model Name. */
    ModelName;
    /**
     * @type {string}
     * @description The Device Form, e.g Phone | Tablet. */
    FormFactor;
    /**
     * @type {string}
     * @description The Device Brand. */
    Brand;
    /**
     * @type {string}
     * @description The Device Dimensions (Height x Width x Depth). */
    Dimensions;
    /**
     * @type {?number}
     * @description The Device display resolution width in pixels. */
    DisplayResolutionWidthPixels;
    /**
     * @type {?number}
     * @description The Device display resolution height in pixels. */
    DisplayResolutionHeightPixels;
    /**
     * @type {?number}
     * @description The Device display width size in inches. */
    DisplaySizeWidthInches;
    /**
     * @type {?number}
     * @description The Device display height size in inches. */
    DisplaySizeHeightInches;
    /**
     * @type {string}
     * @description The Device operating system. */
    OperatingSystem;
    /**
     * @type {string}
     * @description The Device operating system version. */
    OperatingSystemVersion;
    /**
     * @type {string}
     * @description The Device IP Address. */
    IpAddress;
    /**
     * @type {string}
     * @description Any Notes about the device. */
    Notes;
    /**
     * @type {?number}
     * @description Total memory size available (in bytes). */
    TotalMemorySize;
    /**
     * @type {string}
     * @description The Network provider name. */
    CellularProviderName;
    /**
     * @type {string}
     * @description The ISO Country Code of the country the device is currently located in. */
    ISOCountryCode;
    /**
     * @type {string}
     * @description The Mobile Country Code the device is currently located in. */
    MobileCountryCode;
    /**
     * @type {string}
     * @description The Mobile Network Code the device is currently using. */
    MobileNetworkCode;
    /**
     * @type {string}
     * @description The Language Code Identifier that represents the language used on the device. */
    LanguageCodeIdentifier;
    /**
     * @type {string}
     * @description The name of the Timezone the device was last used in. */
    LastKnownTimeZone;
    /**
     * @type {string}
     * @description The UTC Offset of the Timezone the device was last used in.  Formatted as +-##:## */
    LastKnownTimeZoneOffset;
    /**
     * @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 {number}
     * @description The current value of InstanceSeed that the device has stored. */
    InstanceSeed;
    /**
     * @type {number}
     * @description The current value of InstanceCounterLastValue that the device has stored */
    InstanceCounterLastValue;
}

JavaScript RegisterDevice DTOs

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

HTTP + XML

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

POST /xml/reply/RegisterDevice HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<RegisterDevice xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <ApplianceId>00000000-0000-0000-0000-000000000000</ApplianceId>
  <Brand>String</Brand>
  <CellularProviderName>String</CellularProviderName>
  <DeviceId>00000000-0000-0000-0000-000000000000</DeviceId>
  <Dimensions>String</Dimensions>
  <DisplayResolutionHeightPixels>0</DisplayResolutionHeightPixels>
  <DisplayResolutionWidthPixels>0</DisplayResolutionWidthPixels>
  <DisplaySizeHeightInches>0</DisplaySizeHeightInches>
  <DisplaySizeWidthInches>0</DisplaySizeWidthInches>
  <FormFactor>String</FormFactor>
  <ISOCountryCode>String</ISOCountryCode>
  <InstanceCounterLastValue>0</InstanceCounterLastValue>
  <InstanceSeed>0</InstanceSeed>
  <IpAddress>String</IpAddress>
  <LanguageCodeIdentifier>String</LanguageCodeIdentifier>
  <LastKnownTimeZone>String</LastKnownTimeZone>
  <LastKnownTimeZoneOffset>String</LastKnownTimeZoneOffset>
  <Latitude>0</Latitude>
  <Longitude>0</Longitude>
  <MacAddress>String</MacAddress>
  <ManufacturerDeviceNumber>String</ManufacturerDeviceNumber>
  <MobileCountryCode>String</MobileCountryCode>
  <MobileNetworkCode>String</MobileNetworkCode>
  <ModelName>String</ModelName>
  <Notes>String</Notes>
  <OperatingSystem>String</OperatingSystem>
  <OperatingSystemVersion>String</OperatingSystemVersion>
  <TotalMemorySize>0</TotalMemorySize>
</RegisterDevice>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<DeviceModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Eros.Subtle.Canvara.WebAPIModel.ServiceModel">
  <CurrentHistory>
    <CellularProviderName>String</CellularProviderName>
    <DeviceHistoryId>00000000-0000-0000-0000-000000000000</DeviceHistoryId>
    <DeviceName>String</DeviceName>
    <IpAddress>String</IpAddress>
    <LanguageCodeIdentifier>String</LanguageCodeIdentifier>
    <Latitude>0</Latitude>
    <Longitude>0</Longitude>
    <MobileCountryCode>String</MobileCountryCode>
    <MobileNetworkCode>String</MobileNetworkCode>
    <Notes>String</Notes>
    <OperatingSystem>String</OperatingSystem>
    <OperatingSystemVersion>String</OperatingSystemVersion>
    <PrimaryDeviceHistoryDeviceConfigurationId>00000000-0000-0000-0000-000000000000</PrimaryDeviceHistoryDeviceConfigurationId>
    <TotalMemorySize>0</TotalMemorySize>
  </CurrentHistory>
  <DeviceId>00000000-0000-0000-0000-000000000000</DeviceId>
  <DeviceType>
    <Brand>String</Brand>
    <DeviceClassId>00000000-0000-0000-0000-000000000000</DeviceClassId>
    <DeviceClassName>String</DeviceClassName>
    <DeviceTypeId>00000000-0000-0000-0000-000000000000</DeviceTypeId>
    <Dimensions>String</Dimensions>
    <DisplayResolutionHeightPixels>0</DisplayResolutionHeightPixels>
    <DisplayResolutionWidthPixels>0</DisplayResolutionWidthPixels>
    <DisplaySizeHeightInches>0</DisplaySizeHeightInches>
    <DisplaySizeWidthInches>0</DisplaySizeWidthInches>
    <FormFactor>String</FormFactor>
    <ModelName>String</ModelName>
  </DeviceType>
  <InstanceCounterLastValue>0</InstanceCounterLastValue>
  <InstanceSeed>0</InstanceSeed>
  <MacAddress>String</MacAddress>
  <ManufacturerDeviceNumber>String</ManufacturerDeviceNumber>
  <ModelName>String</ModelName>
  <ModelNumber>String</ModelNumber>
  <ResponseStatus xmlns:d2p1="http://schemas.servicestack.net/types">
    <d2p1:ErrorCode>String</d2p1:ErrorCode>
    <d2p1:Message>String</d2p1:Message>
    <d2p1:StackTrace>String</d2p1:StackTrace>
    <d2p1:Errors>
      <d2p1:ResponseError>
        <d2p1:ErrorCode>String</d2p1:ErrorCode>
        <d2p1:FieldName>String</d2p1:FieldName>
        <d2p1:Message>String</d2p1:Message>
        <d2p1:Meta xmlns:d5p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
          <d5p1:KeyValueOfstringstring>
            <d5p1:Key>String</d5p1:Key>
            <d5p1:Value>String</d5p1:Value>
          </d5p1:KeyValueOfstringstring>
        </d2p1:Meta>
      </d2p1:ResponseError>
    </d2p1:Errors>
    <d2p1:Meta xmlns:d3p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
      <d3p1:KeyValueOfstringstring>
        <d3p1:Key>String</d3p1:Key>
        <d3p1:Value>String</d3p1:Value>
      </d3p1:KeyValueOfstringstring>
    </d2p1:Meta>
  </ResponseStatus>
  <SerialNumber>String</SerialNumber>
</DeviceModel>