Theweb storage specification, standardized by theWorld Wide Web Consortium (W3C), has been used to implement a permanent & semi-permanent storage of structured key-value pair data on theDSOS players.
The following APIs are available:
localStorage variables onto the player from external clients through HTTP(S) calls.Added infirmware 4.3.0.Additionally, local storage items can also be manipulated through RPC API and Shared Variables.
The JavaScript API provides two mechanisms for storing key-value pair data on theplayers, respectively onElementi, using these twoJavaScript global objects:
localStorage for permanent data storage, including upon player restart orpublish of new content.sessionStorage for semi-permanent storage, as the data is reinitialized following a player restart or a contentpublish.localStorage.key). The value of an item (i.e. object property) can be read at any time, independently on the time it has been set.ThelocalStorage object enables permanent storage of data, being resilient to player reboots. It provides access to a list of key/value pairs (sometimes called items), that can be set and / or read with the following methods:
// setterlocalStorage.setItem(key,value);// getterlocalStorage.getItem(key);// remove itemlocalStorage.removeItem(key);// remove all items from the local storagelocalStorage.clear();
ThesessionStorage object is identical to thelocalStorage object, except that the data is reinitialized whenever the content restarts, following a player reboot or a contentpublishing. It provides access to a list of key-value pairs (sometimes called items), that can be set and/or read with the following methods:
// settersessionStorage.setItem(key,value);// gettersessionStorage.getItem(key);// remove itemsessionStorage.removeItem(key);// remove all items from the session storagesessionStorage.clear();
The Web Storage REST API allows manipulating thelocalStorage data of the player from external clients through HTTP(S) calls. REST stands for "Representational State Transfer", which is a software architectural style that defines a set of constraints to be used for creating web services. It was added infirmware 4.3.0.
The following operations are supported:

The REST API is deactivated by default – follow these steps to activated it:
To access the API end-points, the security token, generated and stored on the player, must be provided with each call, through a "Bearer Authorization" header or an "access_token" query string parameter. Alternatively, the authentication can be done using the credentials of users defined inuser manager with content authoring or admin rights. BothTLS-SRP andHTTP Basic authentication methods are supported.
spx-api-key={rpcApiKey} query string parameter must be appended to the end-point, where{rpcApiKey} is the API Key configured on that player, either fromControl Center →Advanced Applications → APIs Security section, or by using the<rpc-api-key>configuration tag.The endpointwebstorage allows the following operations:
GEThttp(s)://player_address/webstorage
GEThttp(s)://player_address/webstorage/{key} or /webstorage?name={key}
POSThttp(s)://player_address/webstorage
POSThttp(s)://player_address/webstorage/{key} or /webstorage?name={key}
POSThttp(s)://player_address/webstorage/{key}?expect={value}
DELETEhttp(s)://player_address/webstorage/{key}
PURGEhttp(s)://player_address/webstorage/
Alternatively, this tool can bedownloaded from our server for local usage.
TheRPC API offers severalwebstorage_***RPC commands to interact with the data stored in thelocalStorage. It is especially useful for cases when thecommunication needs to be initialized by the player itself (typical usage is when the player is behind a firewall or a NAT) when using thenative REST API would be problematic.
Shared Variables are automatically saved into thelocalStorage object sincefirmware 3.1.0, thusupdating a Shared Variable triggers a modification within the localStorage object as well.