CS Player HTTP API
CS Player runs a built-in HTTP server that handles local API requests. The server listens on the
127.0.0.1 interface and does not require authentication.
Base URL: http://127.0.0.1:9036/
Get the current playlist of a frame
/current-playlist?frameId=<frameId>{
"playlist": [1, 2, 13],
"playlistEndTime": "12:12:45 09.05.2019",
"currentIndex": 0,
"currentAdvertisement": 13,
"lastTime": 3000
}
| Field | Description |
|---|---|
playlist |
list of advertisement ids in the current playlist |
playlistEndTime |
time until which the playlist stays valid ( |
currentIndex |
current position in the advertisement list |
lastTime |
remaining time of the current advertisement, in milliseconds |
Submit media metering data
/media-metering {
"period": 30000,
"count": 10,
"macAddresses":
[
{
"class": "WIFI",
"signal": "-89",
"address": "A3FFD0897214"
},
{
"class": "BT",
"signal": "-89",
"address": "1234567890AB"
}
]
}
| Field | Description |
|---|---|
period |
Period, in milliseconds, during which the MAC addresses were registered |
count |
Number of unique contacts within |
macAddresses |
Array of globally unique MAC addresses, optional field |
macAddresses.class |
MAC address type (WIFI / BlueTooth) |
macAddresses.signal |
Signal level of the packet the MAC address was taken from, optional field |
macAddresses.address |
MAC address |
Set the current position of a mobile screen
position{
"lat": 56.082698,
"lon": 47.305554
}
| Field | Description |
|---|---|
lat |
latitude |
lon |
longitude |
Trigger-based content playback
execute-trigger/<frameId>{
"trigger": "18",
"type": "interrupt",
"timeout": 1000
}
-
trigger— advertisement trigger identifier, required; -
type— trigger type, required; -
timeout— time in milliseconds, required for types:-
queue-or-interrupt -
queue-or-discard
-
| Type | Description |
|---|---|
interrupt |
show immediately |
queue-or-interrupt |
show within n seconds if the time left until the end of the current advertisement is shorter than the timeout; otherwise show after the timeout |
queue-or-discard |
show within n seconds if the time left until the end of the current advertisement is shorter than the timeout; otherwise discard the trigger |
queue |
queue as the next advertisement |
Server response examples
200 OK
{
"trigger": "18",
"timeout": 2000
}
timeout — time in milliseconds until the player starts showing the triggered advertisement.
404 Not found
{
"error": 404,
"reason": "Frame %d not found",
"trigger": "18"
}