User Manual
|
||||||
Data API
Push Data API List Introduction123 Flash Chat HTTP Server provides some useful data APIs for the third-party application to invoke data by an HTTP request. JavaScriptRequest Format: http://<123 Flash Chat HTTP server IP or domain>:port/DataAPIName.js XML:Request Format: http://<123 Flash Chat HTTP server IP or domain>:port/DataAPIName.js Query Data API ListGet Rooms Data APIThis API is used to get the room list from the HTTP server of the chat. RequestData API name: rooms (.js or .xml) HTTP get parameters:group: group name (eg: group=default) ResponseResponse Data Attributes Description: JavaScript Response Data Format: XML Response Data Format: JavaScript ExampleThe following HTML code will display the rooms' names, it can be copied and pasted to a new HTML file and run smoothly. XML ExampleYou could use any program language to request the URL: http://localhost:35555/rooms.xml, and parse the XML response. Get Room Online Users APIThis API is used to get the user list of a special room from chat HTTP server RequestData API name: roomonlineusers(.js or .xml) Request URL: http://<123 Flash Chat HTTP server IP or domain>:port/ HTTP get parameters: ResponseResponse Data Attributes Description:name: user's name nickname: user's nickname JavaScript Response Data Format: XML Response Data Format: JavaScript ExampleThe following code will display the user's nickname in a room, you could copy and paste the following code into a new html file and run it. XML ExampleYou could use any program language to request the URL: http://localhost:35555/ roomonlineusers.xml, and parse the xml response. Get Online APIThis API used to get the group chat connections, logon users and chat rooms. RequestData API name: online (.js or .xml) Request URL: http:// <123 Flash Chat HTTP server IP or domain>:port/ HTTP get parameters: ResponseResponse Data Attributes Description: JavaScript Response Data Format: JavaScript ExampleThe following html code will display the group chat connections, logon users and chat rooms, you could copy and paste following code to a new html file and run it. XML ExampleYou could use any program language to request the URL: http://localhost:35555/online.xml, and parse the XML response. Push Data API ListSystem Message API Request Data API name: systemmessage.api Request URL: http://<123 Flash Chat HTTP server IP or domain>:port/ HTTP get parameters: msg: the system message will be displayed in the room(obligatory, the msg's value couldn't be empty) group: group name (not obligatory, default value is "default") roomid: specify the room will receive the system message (not obligatory, default value is "1") b: specify whether the message is bold font (not obligatory, default value is "1") u: specify whether the message is underline font (not obligatory, default value is "0") i: specify whether the message is italic font (not obligatory, default value is "0") fontsize: specify the message's font size (not obligatory, default value is "12") color: specify the message's font color (not obligatory, default value is "0x346AA0") Response Success: 0 Error status code meaning: 403: forbidden error, please check your data-api settings in <123flashchat installation directory>/server/etc/groups/default/server.xml 404: request parameters error or request API address error, please check your request URL. Example Simple Example: http://localhost:35555/systemmessage.api?msg=123flashchat Advanced Example: http://localhost:35555/systemmessage.api?msg=123flashchat&group=default&roomid=1&b =1&u=0&i=0&fontsize=12&color=0x346AA0 Broadcast APIRequest Data API name: broadcast.api Request URL: http://<123 Flash Chat HTTP server IP or domain>:port/ HTTP get parameters: msg: the broadcast message will be send to the whole group or to a room (obligatory, the msg's value couldn't be empty) group: group name (not obligatory, default value is "default") roomid: specify the room will receive the message (not obligatory, default value is empty) username: specify the username who send the message (not obligatory, default value is "admin") Response Success: 0 Error status code meaning: 403: forbidden error, please check your data-api settings in <123flashchat installation directory>/server/etc/groups/default/server.xml 404: request parameters error or request API address error, please check your request URL. Example Simple Example: http://localhost:35555/broadcast.api?msg=123flashchat Advanced Example: http://localhost:35555/broadcast.api?msg=123flashchat&group=default&roomid=&username=admin Related links:
|
||||||