SPOT Shared Page API and XML Feed Information
Author: Article Reference #:AA-00006 Views:43332 Date Added:2012-10-26 12:00 AM Last Updated:2014-06-21 11:16 AM 3.75 Rating/ 181 Voters
SPOT API Support:

Current API information:

Be considerate when making API calls, this service is provided free of charge, please do not abuse it. Repeatedly accessing the same feed in very short time periods will result in your IP being blocked or your feed disabled.

If you start receiving a 403 error when you attempt to access your feed it is because you are polling much too quickly and you will need to email in order to get your feed reinstated.  Please allow as least 2.5 minutes between calls of the same feed and if you are pulling multiple feeds have your application sleep at least 2 seconds between feed requests.

The SPOT shared page is built upon an XML data stream that is enabled when a new shared page is created. The glId in the following url is the FEED_ID you will need below. (Please note the glId/FEED_ID in the examples below is non-functional, it is for example purposes only)
The FEED_ID in the above Shared Page URL is: 0XapxKiqW4RCHYhVkaCBpaHT3cNMUcEef

The default content type returned by the API is JSON.  Some browsers apparently display it as XML even though the API returns it as JSON.  If you want to ensure your content type, append the appropriate switch (.xml or .json).

-- The API will only return data from the point where the feed was created, up to a maximum of 7 days. --

Available API usage calls:
Default content-type returned is JSON, adding .xml before any further query string parameters will return XML

Last 50 Messages in XML format:

Paging in increments of 50 in XML format (Note: No ?start= results in newest 50 by default):

Last 50 Messages in JSON format (both are the same request):

Latest - This one will show you the latest message for each device on the shared page, and only the latest message:

The following message types are available via the current feed:
  • OK
  • HELP
  • POI
  • STOP
The XML returned via an feed will look like this:
<?xml version="1.0" encoding="UTF-8"?>
			<message clientUnixTime="0">
				<messageContent>The help message has been cancelled</messageContent>
			<message clientUnixTime="0">
				<messageContent>This is the default HELP message. Please update.</messageContent>
			<message clientUnixTime="0">
				<messageContent>This is a custom message</messageContent>
			<message clientUnixTime="0">
				<messageContent>This is the default SPOT Check-in/OK message. Please update.</messageContent>
			<message clientUnixTime="0">

The XML document will contain 0 or more messages. Only the messengers and message types enabled by the customer will be available in this data stream. Also note that the XML data is cached by our servers. In addition, viewing limits are imposed on all shared page links and abuse of this feature may cause the viewing limits to come into effect. This web service has request limits - Currently it restricts 500 requests,per FeedID in a 15 minute interval. Please contact SPOT API Support if your service plans to make more than 500 requests in a 15 minute interval or please plan to cache the data in your side using a client side proxy.

Appendix A - User side proxy
If the User is using the Shared page XML feed to show the locations in their own website then they can use a caching proxy to significantly reduce the number of requests the SPOT shared service receives. The basic algorithm would be to save the XML feed retrieved from the SPOT service in the local file system. Serve the saved XML data if the time of request falls within 5 minutes of the time of saving the feed. The following sample PHP program can do this:
   // Set this to your link Id
   $linkId = "FEED_ID_HERE";
   // Set this to a directory that has write permissions
   // for this script
   $cacheDir = "./cache/";
   $cachetime = 5 * 60; // 5 minutes
   // Do not change anything below this line
   // unless you are absolutely sure
   $cachefile = $cacheDir .$linkId.".xml";
   header("Content-type: text/xml");
   // Send from the cache if $cachetime is not exceeded
   if (file_exists($cachefile) && (time() - $cachetime
      < filemtime($cachefile)))
      echo "<!-- Cached ".date("jS F Y H:i", filemtime($cachefile))." -->\n";
   $contents = file_get_contents($feedUrl . $linkId);
   // show the contents of the XML file
   echo $contents;
   // write it to the cache
   $fp = fopen($cachefile, "w");
   fwrite($fp, $contents);
Quick Jump
Subscribe to updates Subscribe to Updates
Email to a frien Email to a Friend
Print Print Article
Info Tell your opinion about this article