Screener API

 

Authentication

  The Screener API supports token-based authentication in two ways:

HTTP Basic Auth - Username: the API token - Password: ‘x’

Query String - Pass the API token as auth_token, e.g. ?auth_token=xxxxxxxxxxxxxxxxxxxx

 

Manifest Specification

 

Structure

Each Manifest contains:

  • a name
  • one or more content sources
    • describes the playback content and other settings (specified as a hash)
  • a schedule
    • describes which content source should be playing at any given time (specified as a JSON string)
    • keys for days of the week are mon tue wed thu fri sat sun
    • blackout is a special content source to put the screen in blackout mode
    • e.g. { "default": { "mon": { "0000": "blackout", "0800": "milk", "1900": "blackout" }, "tue": { "0000": "blackout", "0800": "dark", "1900": "blackout" }, ... "sat": { "0000": "blackout", }, "sun": { "0000": "blackout", } } }

  #### Content Source Attributes

Name Description
name required Name of the content.
source required URI of the content.
source_type required Indicates the type of content. Valid values are online or git.
start required A relative URL for the start page. The value can be a blank string, but the attribute itself must be present.
timeout required Period of user interactivity before the start page is reloaded, measured in seconds.
orientation Used to specify content playback orientation. Valid values are portrait or landscape.
username Username for the git repository when the source_type is git.
password Password for the git repository when the source_type is git.
color A hex value to represent the content source. E.g. #ff0000

Note: For Git content sources which require authentication via SSH, the private key is currently bundled with the Android-Agent APK.

  #### Example (Ruby) ruby { "name" => "Chocolates", "content_sources_attributes" => { "milk" => { "source" => "http://git.retrocandy.test/chocolates/milk.git", "source_type" => "git", "start" => "index.html", "timeout" => 20, "orientation" => "portrait", "username" => "xxxxxxxxxx", "password" => "xxxxxxxxxx", }, "dark" => { "source" => "http://git.retrocandy.test/chocolates/dark.git", "source_type" => "git", "start" => "index.html", "timeout" => 20, "orientation" => "portrait", "username" => "xxxxxxxxxx", "password" => "xxxxxxxxxx", } }, "schedule" => "{\"default\":{\"mon\":{\"0000\":\"blackout\",\"0800\":\"main\",\"1900\":\"blackout\"} ... }}" }  

 

How to specify search filters:

Valid conditions for all data types: equals, does_not_equal, in, not_in, is_null, is_not_null.

Valid conditions for strings: contains, does_not_contain, starts_with, does_not_start_with, ends_with, does_not_end_with.

Valid conditions for numbers, dates, and times: greater_than, greater_than_or_equal_to, less_than, less_than_or_equal_to.

Valid conditions for booleans: is_true, is_false.

Valid conditions for non-booleans: is_present, is_blank.

Each condition should be expressed as a key-value pair:

e.g. filters[0][nickname][]=contains&filters[0][nickname][]=chocolate e.g. filters[0][created_at][]=equals&filters[0][created_at][]=2012-03-29+14%3A10

 

Time Zones

Accounts and Signage Networks can specify a time zone so time values (e.g. check-in times) can be displayed correctly.

A Signage Network will try to use its own time zone, providing one is specified. Otherwise it will use the Account time zone, before falling back to Etc/UTC.

Valid time zones:

Pacific/Midway Pacific/Pago_Pago Pacific/Honolulu America/Juneau America/Los_Angeles America/Tijuana America/Denver America/Phoenix America/Chihuahua America/Mazatlan America/Chicago America/Regina America/Mexico_City America/Monterrey America/Guatemala America/New_York America/Indiana/Indianapolis America/Bogota America/Lima America/Halifax America/Caracas America/La_Paz America/Santiago America/St_Johns America/Sao_Paulo America/Argentina/Buenos_Aires America/Guyana America/Godthab Atlantic/South_Georgia Atlantic/Azores Atlantic/Cape_Verde Europe/Dublin Europe/London Europe/Lisbon Africa/Casablanca Africa/Monrovia Etc/UTC Europe/Belgrade Europe/Bratislava Europe/Budapest Europe/Ljubljana Europe/Prague Europe/Sarajevo Europe/Skopje Europe/Warsaw Europe/Zagreb Europe/Brussels Europe/Copenhagen Europe/Madrid Europe/Paris Europe/Amsterdam Europe/Berlin Europe/Rome Europe/Stockholm Europe/Vienna Africa/Algiers Europe/Bucharest Africa/Cairo Europe/Helsinki Europe/Kiev Europe/Riga Europe/Sofia Europe/Tallinn Europe/Vilnius Europe/Athens Europe/Istanbul Europe/Minsk Asia/Jerusalem Africa/Harare Africa/Johannesburg Europe/Moscow Asia/Kuwait Asia/Riyadh Africa/Nairobi Asia/Baghdad Asia/Tehran Asia/Muscat Asia/Baku Asia/Tbilisi Asia/Yerevan Asia/Kabul Asia/Yekaterinburg Asia/Karachi Asia/Tashkent Asia/Kolkata Asia/Kathmandu Asia/Dhaka Asia/Colombo Asia/Almaty Asia/Novosibirsk Asia/Rangoon Asia/Bangkok Asia/Jakarta Asia/Krasnoyarsk Asia/Shanghai Asia/Chongqing Asia/Hong_Kong Asia/Urumqi Asia/Kuala_Lumpur Asia/Singapore Asia/Taipei Australia/Perth Asia/Irkutsk Asia/Ulaanbaatar Asia/Seoul Asia/Tokyo Asia/Yakutsk Australia/Darwin Australia/Adelaide Australia/Melbourne Australia/Sydney Australia/Brisbane Australia/Hobart Asia/Vladivostok Pacific/Guam Pacific/Port_Moresby Asia/Magadan Pacific/Noumea Pacific/Fiji Asia/Kamchatka Pacific/Majuro Pacific/Auckland Pacific/Tongatapu Pacific/Fakaofo Pacific/Apia

Webhooks

 

Screener can make a POST request to a specified URL upon certain events.

  • When a device is registered: screen:registration

  • When a device is de-registered: screen:deregistration

By default, the request body is JSON representation of the Screen.