The Quick Data API can be used for making changes to data in objects without the complexity of managing JSON objects. The purpose of this API is to automate adding data that is used in stack item evaluation.
Data can be sent as a URL encoded form post or as query parameters in the URL.
Quickly updating data for selectively displaying items
For example, to only display an advert for a coat when it is cold and wet, an item may be constructed with the following condition:
temp < 15 && weather == "rain"
To populate the required data to display/hide the item, the following Quick Data API request could be made by an external system that monitors the weather:
/api/screen-data/ABCEF1234567?temp=10&weather=rain
This sets the data named temp
to the value 10 and the data named weather
to the value rain
in the screen with the ID ABCEF1234567
.
This would result in the item being able to display.
Quickly changing screen configuration
The Quick Data API can be used to make data changes that are not part of stack item evaluation. For example, to quickly change the sequence being displayed or to update scrolling text on a screen.
Changes take effect instantly (UDP communications with server required).
/api/screen-data/ABCEF1234567?sequenceId=1234567ABCDEF
Display the sequence with ID 1234567ABCDEF
on the screen with the ID ABCEF1234567
.
/api/screen-data/ABCEF1234567?scrollingText=HelloWorld!
Display the scrolling text HelloWorld!
on the screen with the ID ABCEF1234567
.
Removing data
To remove data from an object, provide the name and equals with no value.
/api/screen-data/ABCEF1234567?scrollingText=
Remove the data named scrollingText
from the screen with the ID ABCEF1234567
.
Quickly changing other data
The Quick Data API can also be used to quickly update data in other objects.
Sequence data
/api/sequence-data/1234567ABCEF?offer=1
Sets the data named offer
to the value 1
in the sequence with the ID 1234567ABCEF
.
User data
/api/user-data/1A2B3C4D5E6F7?label=Joe%20Blogs
Set the data named label
to the value Joe Bloggs
in the user with the ID 1A2B3C4D5E6F7.
Library Item data
/api/libraryitem-data/1A2B3C4D5E6F7?label=Promotion
Sets the data named label
to the value Promotion
in the library item with the ID 1A2B3C4D5E6F7.
Updating multiple screens in a group
The group-screen-data
endpoint can be used to modify data of all screens within a group using a single request. For example:
/api/group-screen-data/london.screens?overrideTimeZone=Europe/London
Overrides the timezone of all screens in the group named london.screens
with overrideTimeZone=Europe/London
.
The response body will be OK
if at least one screen was updated or a 404 if the group is not found or there are no screens in the group
Filtering a group of screens by condition
To only update some of the screen in a group, a filter
parameter can be used.
The filter condition is applied to data in each object. Only screens with data satisfying the condition will be updated.
Example filters:
?filter=mycustomkey=="mycustomvalue"
?filter=androidSdk>20&&screenSize<55
URL encode the filter to encapsulate special characters. The above filters should be sent as:
?filter=mycustomkey%3D%3D%22mycustomvalue%22
?filter=androidSdk%3E20%26%26screenSize%3C55
When using a filter, the response will be a list of screen IDs that were updated or a 404 response if the group is not found or no screens matched.
Java Code Examples
Some examples demonstrating how to use the quick data API in a Java application:
Comments
0 comments
Please sign in to leave a comment.