...
This example describes the player entity, but the same solution is implemented for all other entities (for example, groups, feeds, playlists, etc.).
Although only version 2020/10 of the BSN.cloud Main API is specified on this page, version 2022/06 is also supported and can be used instead.
Example
The BSN.cloud Main API currently exposes the following player management methods which accept optional filter and sort expressions:
GET ~/2020/10{{version}}/REST/Devices/[?marker={string}][&pageSize={byte}][&filter={expression}][&sort={expression}]
which retrieves the paged list including up to 100 'BSN.WebServices.Main.v202010.DTO.Device' instances starting from specified marker, matching the specified filter expression and sorted in accordance to specified sort expression.
GET ~/2020/10{{version}}/REST/Devices/Regions/{*locationPath}/[?filter={expression}]
which retrieves the list of 'BSN.WebServices.Main.v202010.DTO.DevicesRegion' providing the aggregated information of locations of 'BSN.WebServices.Main.v202010.DTO.Device' instances matching the specified location path and filter expression.
GET ~/2020/10{{version}}/REST/Devices/Count/[?filter={expression}]
which retrieves the number of 'BSN.WebServices.Main.v202010.DTO.Device' instances matching the specified filter expression.
PATCH ~/2020/10{{version}}/REST/Devices/[?filter={expression}]
(in development) which applies the specified changes to 'BSN.WebServices.Main.v202010.DTO.Device' instances matching the specified filter expression.
DELETE ~/2020/10{{version}}/REST/Devices/[?filter={expression}]
which deletes the 'BSN.WebServices.Main.v202010.DTO.Device' instances matching the specified filter expression.
...
Each filter expression may contain one or more criteria combined by AND/OR operators and optionally grouped by parentheses.
Each criteria may be based on property name, system tag, or custom tag.
All property names are based on data contract of the target Main API version - the client specifies only what it sees at the moment of integration and does not change later. This means that clients using Main API v202010 refer to the Player Health Status property as
[Status].[Health]
, expecting to get one of { “Disconnected”, "NoSubscriptions", "Normal", "Warning", or "Error" } enumeration values. Clients which use a later version will refer to it at some different path and will expect even different, more specific values and all of that must be supported at the same time based on the same internal dataset. It means that regardless of the target Main and Device API versions used by customers and players for reporting Player Settings and Status this information must be available for retrieval and handle expressions of all existing formats in all Main and Device API versions at the same time.
According to initial business requirements the Main API must support filtering and sorting by all properties exposed in its data contracts. But due to syntax specifics the list of supported 'Player' entity properties in v2020/10 is currently limited to the following, as defined in 'BSN.WebServices.Main.v202010.DTO.Device' and referenced classes:
[Id] // integer
[Serial] // string
[Model] // string-enumeration
[Family] // string-enumeration
[RegistrationDate] // DateTime
[LastModifiedDate] // DateTime
[Settings] // object
[Settings].[Name] // string
[Settings].[Description] // string
[Settings].[ConcatUnitNameAndSerial] // boolean
[Settings].[SetupType] // string-enumeration
[Settings].[Group] // object
[Settings].[Group].[Id] // integer
[Settings].[Group].[Name] // string
[Settings].[BrightWall] // object
[Settings].[BrightWall].[Id] // integer
[Settings].[BrightWall].[Name] // string
[Settings].[BrightWall].[Screen] // byte
[Settings].[Timezone] // string
[Settings].[Screen] // object
[Settings].[Screen].[IdleColor] // string
[Settings].[Screen].[SplashUrl] // string-URL
[Settings].[Synchronization].[Status] // object
[Settings].[Synchronization].[Status].[Period] // TimeSpan
[Settings].[Synchronization].[Settings] // object
[Settings].[Synchronization].[Settings].[Period] // TimeSpan
[Settings].[Synchronization].[Schedule] // object
[Settings].[Synchronization].[Schedule].[Period] // TimeSpan
[Settings].[Synchronization].[Content] // object
[Settings].[Synchronization].[Content].[Start] // nullable TimeSpan
[Settings].[Synchronization].[Content].[End] // nullable TimeSpan
[Settings].[Network] // object
[Settings].[Network].[Hostname] // string
[Settings].[Network].[ProxyServer] // string
[Settings].[Network].[ProxyBypass] // string array
[Settings].[Network].[TimeServers] // string array
[Settings].[Network].[Interfaces] // object array
[Settings].[Beacons] // object array
[Settings].[Location] // object
[Settings].[Location].[PlaceId] // string
[Settings].[Location].[GPSLatitude] // nullable double
[Settings].[Location].[GPSLongitude] // nullable double
[Settings].[Location].[Country] // string
[Settings].[Location].[CountryLongName] // string
[Settings].[Location].[AdminAreaLevel1] // string
[Settings].[Location].[AdminAreaLevel1LongName] // string
[Settings].[Location].[AdminAreaLevel2] // string
[Settings].[Location].[AdminAreaLevel2LongName] // string
[Settings].[Location].[Locality] // string
[Settings].[Location].[LocalityLongName] // string
[Settings].[Location].[Path] // string
[Settings].[Location].[PathLongName] // string
[Settings].[Screenshots] // object
[Settings].[Screenshots].[Interval] // TimeSpan
[Settings].[Screenshots].[CountLimit] // unsigned short
[Settings].[Screenshots].[Quality] // byte
[Settings].[Screenshots].[Orientation] // string-enumeration
[Settings].[Logging] // object
[Settings].[Logging].[EnableDiagnosticLog] // boolean
[Settings].[Logging].[EnableEventLog] // boolean
[Settings].[Logging].[EnablePlaybackLog] // boolean
[Settings].[Logging].[EnableStateLog] // boolean
[Settings].[Logging].[EnableVariableLog] // boolean
[Settings].[Logging].[UploadAtBoot] // boolean
[Settings].[Logging].[UploadTime] // nullable TimeSpan
[Settings].[LWS] // object
...
[Settings].[LWS].[Password] // string
[Settings].[LWS].[EnableUpdateNotifications] // boolean
[Settings].[LDWS] // object
[Settings].[LDWS].[Password] // string
[Settings].[LastModifiedDate] // DateTime
[Status] // object
[Status].[Group] // object
[Status].[Group].[Id] // integer
[Status].[Group].[Name] // string
[Status].[BrightWall] // object
[Status].[BrightWall].[Id] // integer
[Status].[BrightWall].[Name] // string
[Status].[BrightWall].[Screen] // byte
[Status].[Presentation] // object
[Status].[Presentation].[Id] // integer
[Status].[Presentation].[Name] // string
[Status].[Presentation].[Type] // string-enumeration
[Status].[Timezone] // string
[Status].[Synchronization] // object
[Status].[Synchronization].[Settings] // object
[Status].[Synchronization].[Settings].[Enabled] // boolean
[Status].[Synchronization].[Schedule] // object
[Status].[Synchronization].[Schedule].[Enabled] // boolean
[Status].[Synchronization].[Content] // object
[Status].[Synchronization].[Content].[Enabled] // boolean
[Status].[Script] // object
[Status].[Script].[Type] // string-enumeration
[Status].[Script].[Version] // string
[Status].[Script].[Plugins] // object array
[Status].[Firmware] // object
[Status].[Firmware].[Version] // string
[Status].[Storage] // object array
[Status].[Network] // object
[Status].[Network].[ExternalIp] // string
[Status].[Network].[Interfaces] // object array
[Status].[Uptime] // TimeSpan
[Status].[CurrentSettingsTimestamp] // DateTime
[Status].[CurrentScheduleTimestamp] // DateTime
[Status].[Health] // string-enumeration
[Status].[LastModifiedDate] // DateTime
[Subscription] // object
[Subscription].[Id] // integer
[Subscription].[Device] // object
[Subscription].[Device].[Id] // nullable integer
[Subscription].[Device].[Serial] // string
[Subscription].[Type] // string-enumeration
[Subscription].[ActivityPeriod] // TimeSpan
[Subscription].[Status] // string-enumeration
[Subscription].[CreationDate] // DateTime
[Subscription].[ActivationDate] // nullable DateTime
[Subscription].[SuspensionDate] // nullable DateTime
[Subscription].[ExpirationDate] // nullable DateTime
[TaggedGroups] // object array
[Tags] // object
[Permissions] // object array
System and Custom Tags
In addition to properties each 'Player' entity instance may have a different set of system and custom tags specified by customer, exposed via the [Dictionary<string, object>] Tags
property and managed via the following BSN.cloud Main API methods:
...
Each system and custom tag must be explicitly specified for the target entity instance but the list of available system tags is pre-defined predefined by product owners and mapped to some properties so their values must be always in sync. For example, the system tag mapped to the Player Health Status property is called:
string::[Device].<HealthStatus>
...
Property and Tag Mentions in Expressions
...