CMS Version (and API version)
4.2.0 (on premise)
Player Type
Windows
Player Version
A somewhat recent version granted we installed this at most a few months ago, however I cannot seem to find how to view this information?
Issue
Hello.
I’m working on using Xibo to display up-to-date information from my organization’s case management system. The approach I’ve taken for this is to update DataSets via the Xibo API, which (with a bit of grueling detective work) I managed to get working quite smoothly!
One of the layouts I designed was meant to showcase important cases. For this layout, however, I wanted to control wheter it should be shown or hidden depending on if there were any important cases active.
The solution for this seemed obvious: Use schedule criteria! Even better, there was an API endpoint for it as well, specifically: POST /displaygroup/criteria[/{displayGroupId}]
.
Now, working with this endpoint has been an… interesting journey.
Here’s a bunch of “fun” undocumented discoveries I made while working with it:
- Even though the description of the endpoint states that
displayGroupId
is an optional parameter, it is, in fact, not optional in the slightest. - Passing
value
as a string containing only numbers (such as"0"
), will result in aHTTP 500
error urging you to contact support (and here I am!).
But, more importantly, it just does not work? At all? Despite responding with HTTP 204
, absolutely nothing appears to work with these things. Let’s do a practical example:
-
I make the following request to the Xibo API (it responds
HTTP 204
)response = requests.request( "POST", API_URL_XIBO + "/displaygroup/criteria/17", # This displaygroup is applied to all screens. headers = { "Content-Type": "application/json", "Accept": "application/json", "Authorization": "Bearer " + access_token }, json = { "criteriaUpdates": [ { "metric": "important_case_active", "value": "TRUE" if incident_count > 0 else "FALSE", "ttl": 0 # Infinite TTL? I've tried with 3600 as well. } ]}, verify = False )
(This is python, using the requests module to make API calls)
-
I go to the schedule page on the Xibo CMS, and create a new event. I assign it a layout (or campaign, it doesn’t affect the outcome), and then set the criteria to the following:
This screen is also pretty interesting.The API only supports strings, but the condition list here makes it seem that numbers are, in fact, supported. What’s going on here? -
I place the above event to my screens and wait for them to update. Once that’s done…
-
The layouts assigned appear on screen! Always… regardless of what any criteria is set to. Even with a ridicolous criteria like
(Wheather app) windSpeeds greaterThan 99999
it still kept showing up.I did also fiddle with priority and order, but that didn’t do anything either.
While we’re at it: is there any way to view criteria currently applied to a screen? Either it does not exist, or I simply cannot find it.
I apologize for the frustration, but this has been something of an experience to debug.
Is this a bug with criteria? Am I doing something wrong? Is there an alternative approach that can achieve the same results? (I can imagine something like deleting and creating new events via the API, but that sounds like a terribly unelegant solution).
Please help!
Regards,
Oskar Nilsson