Get started with API

Live Center API outline

  •          Examples with the test-channel 3282 and the tenant key “ftest2”. Change those to your tenant key and channel id to try it out on your own channels.
  •          All HTTP results are returned in an object with a “success” flag and a “result” property if the request succeeded. On error, a message is provided in a “errMessage” property.
  •          These examples cover a typical API usage scenario, not the format of the posts

1: Fetch the initial state of a channel

Example: https://livecentercdn.norkon.net/BulletinFeed/ftest2/3282/Initial/

This provides JSON content of the most recent posts, a JSON object for meta-data surrounding the channel (such as countdowns), and a “lastChangesId” that can be used for polling with HTTP.

Example response:

{  
   "success":true,
   "result":{  
      "table":22207263,
      "channelContent":{  }, //Metadata for the channel
      "lastChangesId":563905, //Last changes ID used for HTTP polling
      "addedOrChanged":[  ], //Most recent posts, follows same naming convention as with polling
      "ts":1566565993, //Timestamp of when the response was generated
      "hasMore":false //Whether there are more posts available
   }}

2.1: Connect with websockets

Example:  wss://livecenterws.norkon.net/BulletinWebSocket/ftest2/3282

Any updates to existing posts or any new posts will be provided here. It replays any updates for the past 30+ seconds on connect to update the “initial” state as it will be cached for up to 30 seconds.

Example message for added post:

{  
   "added":[  
      {  }
   ],
   "channelId":3282,
   "lastChangesId":573086}

2.2: Poll with HTTP

Example: https://livecentercdn.norkon.net/BulletinFeed/ftest2/3282/Changes/563905

If websockets are not available, you can poll on this endpoint on an interval basis. Provide the last changes id and you will get any updates since the last change.

Example response:{  
   "success":true,
   "result":{  
      "ts":1566566308,
      "lastChangesId":573086, //Use this new id for subsequent requests
      "addedOrChanged":[ ] //Any added or changed posts
   }}

3: Get older posts

Example: https://livecentercdn.norkon.net/BulletinFeed/ftest2/3282/EarlierObj/461036/

If the user wants to get older posts (typically a “load more” button triggers this), this endpoint can be used to fetch older posts. Provide the last post id you have, and you will get the older posts in the channel.

Example response:

{  
   "success":true,
   "result":{  
      "table":22207263,
      "hasMore":false, //Whether there are even more posts available
      "bulletins":[  ] //The history
   }}