API Reference Guide
For the Userful Visual Networking Platform
API Introduction
The Userful REST API enables users to programmatically interact with the video walls and displays to have better control over them. Any programming language that supports HTTP such as Java, Python, C#, JavaScript etc. can be used for communicating via REST API. You can use a REST API Client for quick debugging and testing of REST API commands.
Note:
This API guide is for the Userful Visual Networking Platform (Version 11x).
To learn about APIs for Userful Infinity, visit API Guide - Userful Infinity Platform.
This document assumes that user is aware of the programming language used for building REST API code and will walk you through the steps and some examples that will help you getting started with Userful REST API.
For the list of REST API commands for the Userful Visual Networking Platform (Version 11x), visit https://api.userful.com/11/.
API User Authentication
Please ensure that a valid user name and password is required to use Userful REST API. The API POST /session
allows you to send a username and password to log in. If the authentication is successful you will get a response from the server with your unique session ID. An example session ID looks like this:
Once the ID is available, send it as a cookie parameter together with every other API command. With Javascript or HTML you don't have to do this, as the browser will manage the cookie for you.
Getting Started with the REST API
Running your first few commands
Ensure that any REST API Client is installed for the purpose of testing. This will aid in quick debugging and testing of REST API commands.
Find the IP address of your server. If you normally access the Control Center with a URL of, for example, http://192.168.120.199/ucc.html
, Then you will use http://192.168.120.199
to access the server.
Configure all necessary Zones and Sources, using naming conventions you will remember. For the purpose of this example, we will assume that the names are: zone_1
, source_1
, and source_2
.
Paste the following command into REST API Client and test it. This will switch zone_1
to play source_2
.
Assign zone_1
to source_2
:
Choose PUT method and click "Send".
Play source_2
on zone_1
:
Choose PUT method and click "Send". This will play source_2
on zone_1
.
Communicating with the API
To communicate with API, write a client program in the programming language that you are familiar with. Here are some code samples written in Python, JavaScript and C#.
Python
In the following example,two API calls are demonstrated by constructing two functions respectively:
login -> POST /api/session
(Login to the system with username and password)
play -> PUT /api/zones/byname/{zoneName}/playAssignedSource
(Play the assigned source on the zone by given its zone name)
JavaScript
For security, AJAX requests must be made from the same domain. This feature is known as Cross-origin resource sharing. When developing, disable it on Google Chrome or Chromium as follows:
Sending a Broadcast Alert:
Explanation
This js function will make an AJAX call to the server to broadcast a message on the screen. The url for this rest command is
The HTTP method is PUT.
The parameters are: message ("Hello World"), alertLevel ("RED_LEVEL") and duration in milliseconds (6000). The function call will be simple as
You have options to handle the cases where the broadcast is successful or not. In this example you will get different message boxes. Most AJAX functions are similar to this example.
Play the profile assigned to the zone
This function takes the zone ID and plays it, for example
Stop playing a zone
Switch a zone to another source
Make a playlist and play it on a zone
C#
You may need namespaces such as Newtonsoft.Json for JSON manipulation, System.Net.Http and System.Net.Sockets for networking.
Get the session ID value
The following code snippet will send user name and password strings to the server and retrieve the session ID from the cookie, in response from the server.
Get source information
Use API GET /sources to get the list of sources available on the server. This code snippet will first authenticate with the sever and then send the request to get the source list.
Last updated