The Bot Libre web API |
In addition to being able to embed your live chat channel on your own website, and access them from any Android device, you can also access your channel through the Bot Libre web API. The web API gives you the advantage of having complete control of your channel's client interface. You can use the web API to access your channel from your own website through JavaScript, PHP or any other language. You can also use the web API to create your own mobile application to access your channel, such as an Android or iOS application. A web API, is a set of HTTP GET/POST URI's that allow sending and receiving of message data. When you browse a website, your browser makes a series of HTTP GET/POST requests to URIs that return HTML content. In a web service the URIs return XML or JSON data, instead of HTML content. The LIVE CHAT libre web API consists of two parts, a REST API with XML message content, and a web sockets API for distributed communication. The REST API takes HTTP POST XML data, and returns XML data.
HTTP XML POST API
create-userThe create-user API creates a new user, and returns the user's details.
URI: http://www.botlibre.biz/rest/api/create-user
XML POST Example
check-userThe check-user API validates a user, and returns the user's details.
URI: http://www.botlibre.biz/rest/api/check-user
Parameters
XML POST Example
get-channelsThe get-channels API queries the details for all channels matching the criteria.
URI: http://www.botlibre.biz/rest/api/get-channels
XML POST Example
check-channelThe check-channel API validates that a channel ID or name exists, and returns the channel's details.
URI: http://www.botlibre.biz/rest/api/check-channel
Parameters
XML POST ExampleWeb Socket APIThe web socket API uses web sockets to communicate with the Bot Libre server. Most web browsers support web sockets from JavaScript, you can also get free open source web socket implementations for most programming languages, and mobile platforms.Here is some example web socket code using JavaScript in a web browser. It assumes an HTTP connection has already been made to the Bot Libre server. If you have not connected to a channel through a web session, you can still establish a connection. Once you establish a connection, you will need to send a text message to connect to a channel of the form "connect channel-id user password application-id".
So, that is the basic web API. You can now build your own interface for your channel. You can use the API on your own website, or in your own mobile application. For a complete Java code example of using the full API, refer to the SDK source code on Bot Libre on GitHub. |
|||||||||||||||||||||
|
|||||||||||||||||||||
|