Many churches, universities, and companies use EMS (Event Management Systems) from Dean Evans and Associates for facility management and room reservations. We are one of those organizations.

It’s important to us to have an authoritative source for events. Rather than having separately managed calendars for each department and group, it’s critical that we have a centrally-managed system to manage university events and spaces.

Is EMS the best product in the world?

Nah, kid. EMS is NOT the best, but it is good. I get so frustrated with little aspects of their software. Namely, their out-of-the-box products like Virtual EMS and Master Calendar are very difficult to customize to match the look and feel of our Web site. As a result, we’ve made a whole lot of custom integrations to make up for shortcomings in those products. In fact, I loathe Master Calendar so much, even with the recent (albeit massive) upgrades to the product, that we pay a pretty penny to Localist for our public calendar.

That being said, EMS is really good at its core purpose – managing rooms and resources. It is REALLY good at that. Our Event Services team loves the product, because it meets every single one of their needs.

So, how do I get data from EMS to display on digital signage?

There are a couple of ways that you can accomplish this. My favorite way is to use the API. The EMS API is an enterprise tool, and you must request it from your account admin. There are two levels. The first level gives read-only access to EMS, and the second level adds the ability to write back to the database. The second level costs more money, and we didn’t need the ability to write data back to EMS, so we’re only using the read-only API.

You could also buy signage solutions from EMS. But, yuk.

You could buy Crestron products that tie in to EMS. We did this in one of our buildings, and we HATE it. It fails often, the motion sensors don’t pick you up unless you’re about an inch away from the screen, and the wording cannot be customized at all.

You could use the RSS feed from Master Calendar, if you use that product.

You could get the data directly from SQL. The EMS data structure is pretty easy to understand. This is how we handle our outputs to Localist for our public calendar.

The choice is yours, but for this article, let’s look more closely at the API.

Using the EMS API to display event data

The first step to using the API is to install the API on your EMS Web Server. Then you’ll need to create a user in EMS with the correct permissions. All of these steps are included with a PDF that your account manager will send your way, upon request. I couldn’t find it on the Interwebz to link to, but your account manager will be able to help out.

After you’ve got a user, you’ll need to hop on a Web server with PHP and SimpleXML installed, and create a script. Call it whatever you like… signage.php, or time-to-take-over-the-world.php, it’s up to you.

For this example, I’m going to show you how to output all events from all buildings in the next two days.

Start off by connecting to the API

You’ll want to change the with the server that hosts your EMS API. Then change ENTER_YOUR_USERNAME and ENTER_YOUR_PASSWORD with the credentials for an EMS user with API access. It’s probably best to make an API user that is ONLY for that purpose.

For the start date, you’ll notice that We’re just setting it to midnight today, and for the end date, we’re adding 2 days (2 * 24 * 60 * 60) to the current time. The building ID is set to -1, which returns all buildings. Set this to a specific building ID to filter results.

Then the simplexml_load_string takes the XML response from the API and turns it into a PHP object.

Loop through the Results

I’m not sure which order the results come in, but I can tell you that they are not ordered by time.

Looking back at this, I’m not sure why I used a for loop and limited it to 300 results, but I did. A foreach loop would probably be better. There are a lot of attributes that get returned from the API. You can see everything by doing a print_r($xml); The only ones that I needed were Event Name, Event Start, Event End, Event Type, Building Name, and Room Number. So, I set each of those in the first few lines.

The line referencing the Status IDs of 1 and 7 is there to weed out events that aren’t confirmed. In our implementation, Statuses with ID 1 are “Confirmed,” and those with ID 7 are “Academic Confirmed.” The other statuses are different variations of requests and rejects… since they’re not confirmed, we don’t want to use them. You’ll need to update this line in your script.

Then, I push them to the output array so that we can sort it by time after we’re finished looping through.

Creating HTML from it

After you have it in a sorted array, loop back through those keepers, and make ’em pretty.

Then, all that’s left to do is to echo $output; in an area you’d like to display it.

What Else?

The sky is the limit here. Instead of generating HTML, you could generate a CSV so that software like FourWinds can consume it. Or, you could pare the results down to just those in the next hour. There’s a lot that you can do once you have the data in a structured format.

Give me a shout in the comments if you have questions!

Photo Credit: fullo (cc)