Architecture/Interface/Chat

Chat Interface
Chat messages are queued by the viewer and are read via a GET request on the chat request URL. A chat message from the user is entered with a POST.

The chat URL is http://localhost:9144/api/chat.

The format of the GET response is a JSON map which, for each message, gives the time and the parameters for the message. A response could look like: { "200912121023344435": {   "Time": "20091212102334435", "From": "Fred Flintstone", "Message": "Yaba daba doooo", "Type": "Shout", "EntryType": "Normal" }, "20091212102336216": {   "Time": "20091212102336216", "From": "Wilma Flintstone", "Message": "Fred! What will the Rubbles think?", "Type": "Whisper", "EntryType": "Normal" } } This would be the response if two people had spoken since the last chat fetch. As you can see this is a map of maps with each of the latter being messages and the time being duplicated in the outer map.

The definitions of the fields are:

Sending a chat message is accomplished by POSTing to the chat url a message with the JSON body which looks like: { "Message": "Betty, what do you think is going on over there.", "Channel": "0", "Type": "Normal" }

{| border="1" !Property !Value description
 * Message
 * The text of the message
 * Channel
 * the number of the channel speaking on. Zero is general chat.
 * Type
 * one of "Normal", "Whisper", "Shout"
 * Type
 * one of "Normal", "Whisper", "Shout"
 * one of "Normal", "Whisper", "Shout"