TaPingYa is a simple room based communication and collaboration site.
The goal is to create a place where people can go and talk, share
information, and also collect and collaborate. TaPingYa has a complete
API that allows it to be used through other applications. Visit the TaPingYa site at : http://www.tapingya.com
Embedding Chat Room with IFRAMEThe easiest integration of TaPingYa is to use an iframe to embed a room into your site. The URL accepts a "stylesheet" parameter, which points to a .css file hosted elsewhere. This allows you to style the chat messaging to fit the needs of your site. A standard iframe example is as follows:<iframe src="http://www.tapingya.com/room/popup?room_id=1638&password=&stylesheet=http://mysite.com/mystyle.css" width="400" height="800"></iframe> You can leave out the "stylesheet" parameter and the room will use the default style. The "password" parameter must have the rooms password (in MD5 format) if one exists. Otherwise, you can leave it empty or not include it. SecurityFor external API use, TaPingYa supports Basic Authentication. You need to set a tapingya username and password using Settings in the main site. You can then login with Basic Auth using those credentials.Presence and ActivityIn order to be recognized within a room, the Recent Messages API call must be called within a 20 second time window or the user will be displayed as out of the room. Additionally, activity must be posted by a user within 4 hours in order to not be "kicked" from a room. This is to prevent camping, forgotten sessions, and general bandwidth waste. Kicking will result in no responses from the host until activity criteria is met again (post a message, link, or task).API MethodsAll API methods are pre-pended by the URL of the site (http://tapingya.appspot.com). This URL may change in the future. For example, to get a list of rooms, make an HTTP GET request to the following:http://tapingya.appspot.com/api/rooms All methods use basic HTTP GET or POST requests. Results are always in JSON format or plain text. XML is not supported currently. Samples and libraries can be found at TaPingYa API Files and Samples. JSON ResultsMessagesBelow is a sample JSON result for message requests. {"servertime":"2008/10/09 19:31:47 +0000","messages":[{"creator":"testuser","alias":"testuser","source":"","key":"agh0YXBpbmd5YXIOCxIHTWVzc2FnZRjeCQw","time":"2008/10/09 18:13:06 +0000","message":"yeah, it was before the test. oh well","type":0,"id":"1246"}]} Guests Below is a sample JSON result for guest requests. {"guests":[{"guest":"NerdForceMaster"},{"guest":"Scott1055"},{"guest":"bvelasquez"},{"guest":"chris.shumway"},{"guest":"pderksen2"},{"guest":"seankcsci2"}]} RoomsReturns a list of rooms sorted by name. Can specify count and page number.Path : /api/rooms Method : GET Parameters : count : The number of results you would like. Default is 25. page : The page number, from 0-N. Default is 0. Result : Returns a string in JSON format of the rooms. New RoomsReturns a list of rooms sorted by creation date in descending order.Path : /api/rooms/new Method : GET Parameters : count : The number of results to return. Updated RoomsReturns a list of rooms sorted by modified date in descending order.Path : /api/rooms/updated Method : GET Parameters : count : The number of results to return. Send Ping RequestPosts a ping to the server, indicating that the user that sent the ping is in the room. This method is useful in indicating presence, without polling for recent messages.Path : /api/room/ping Method : POST Parameters : count : The number of results to return. Messages for a RoomRetrieves the latest messages for the specified room.Path : /api/messages Method : GET Parameters : room_id : The ID of the room. count : The number of results to return. page : The page number of results. format : If set to "textile", the results will be formatted according to textile parsing. password : The room password if one exists. Result : Returns a string in JSON format of the messages. Recent Message for a RoomRetrieves only the most recent messages for a room, depending on the number of milliseconds back to look. This method also signals your presence in a room. Presence must be reported within 20 second intervals in order to be reported as present in a room. Activity must be posted in the form of a posted message, link, or task update within 4 hours or the user will be kicked and kick responses returned instead of updates.Path : /api/messages/recent Method : GET Parameters : room_id : The ID of the room. timeback : How many milliseconds to look back from UTC now (server time). count : The number of messages to retrieve. format : If set to "textile", the results will be formatted according to textile parsing. password : The room password if one exists. Result : Returns a string in JSON format of the messages. Post a Message to a RoomPost a new message to the specified room.Path : /api/messages/post Method : POST Parameters : room_id : The ID of the room. message : The message to post. source : The source of the message (optional). password : The room password. Result : A string of the message key. Create a new RoomCreates a new Room.Path : /api/room/new Method : POST Parameters : name : The name of the new room. password : The password to set on the room. redirect_url : A URL to redirect to after the post. Result: Returns the key of the new room. Update an Existing RoomUpdates the properties of an existing room.Path : /api/room/update Method : POST Parameters : room_id : The ID of the room. name : The name of the room. password : The password of the room. description : The description of the room. redirect_url : A URL to redirect to after the post. Result : The key of the Room. Return Room ID from KeyReturns the Room ID from the Room Key.Path : /api/room/id Method : GET Parameters : key : The key of the room. Result : The ID of the Room. Return Room Key from IDReturns the Room Key from the Room IDPath : /api/room/key Method : GET Parameters : room_id : The ID of the room. Result : The key of the room. Active Guests in RoomRetrieves the currently active guests. Guests are active if they are retrieving recent messages or sending ping requests.Path : /api/room/guests Method : GET Parameters : room_id : The ID of the room. secondsback : How many seconds back the Guest must have pinged or requested recent messages. password : The password of the room. Result : Returns a string in JSON format of the guests. Set Guest AvatarSets the Guests Avatar Image.Path : /api/guest/image/set Method : POST Parameters : avatar : The image. redirect_url : A URL to redirect to after the post. Result : Returns the Guest Key. Get Guest AvatarRetrieves the Guests Avatar.Path : /api/guest/image/get Method : GET Parameters : handle : The handle of the guest. The handle is the Google Nickname. Result : Returns the image. Content type is image/png. Set Guest ProfileSets the Guests Profile properties.Path : /api/guest/profile/set Method : POST Parameters : status : The status message for the guest. alias : An alias to use instead of the default Google nickname. redirect_url : A URL to redirect to after the post. Kick GuestKicks the guest from the room, which removes them from the room and stops sending updates on their request. This is used to remove campers or forgotten sessions. This can only be executed by the room owner.Path : /api/guest/kick Method : POST Parameters : room_id : The ID of the room to kick them from. nickname : The nickname of the guest to kick. duration : How long (in seconds) before they can re-enter. |