Friday, September 12, 2014

Embedding your bot on your own website with the Paphus Live Chat JavaScript SDK

Paphus Live Chat enables you to embed chat bots, live chat, chatrooms, and forums on your own website. It is quite easy to embed content, and only takes a few lines of HTML code. You can embed content on your website to provide help or customer service, to provide information, or just for fun.

The embedding HTML code can be copied from your bot/channel/forum's Embed page under Admin.

The simplest solution is to embed content inside your webpage using an iframe. This just displays embedded content directly from the Paphus Live Chat website inside your webpage. The Embed page provides lots of options that let you customize the embedded content, such as changing the background color, changing the prompt and button text, or even providing your own CSS style sheet.

Another option is to access the Paphus Live Chat web API from your website's server (PHP/Java/etc.), or to access the web API from JavaScript. Using the API directly gives you complete control over the interface to your content. Paphus Live Chat now provides an open JavaScript SDK that makes embedding and accessing a bot using JavaScript a lot easier.

To Paphus Live Chat JavaScript SDK is provided as open source under Project libre on GitHub and SourceForge. The Paphus Live Chat SDK includes a Java and Android SDK and components, and now includes a JavaScript SDK.

To add the Paphus Live Chat JavaScript SDK to your webpage you just need to import it in your webpage's <head> section.

The SDK provides several components that lets you access Paphus Live Chat's services including:

  • SDK - static class providing services such as Text To Speech (TTS), debugging, and configuration.
  • SDKConnection - class providing access to the Paphus Live Chat web API through JavaScript Data Transfer Objects (DTO). This includes chat bots, live chat, forums, and user administration.
  • WebChatbotListener - class that links the chat bot web API to an HTML form.
  • LiveChatConnection - class providing access to Paphus Live Chat's live chat web socket API.
  • LiveChatListener - interface for live chat.
  • WebLiveChatListener - class that links the live chat API to an HTML form.
  • Credentials - class to provide your application credentials including your application id.
  • ChatConfig - DTO class to provide a chat bot message.
  • ChatResponse - DTO class to provide a chat bot response.
  • UserConfig - DTO class to provide user information.
  • BrowseConfig - DTO class to browse or search the bot/channel/forum/domain directory.
  • InstanceConfig - DTO class to provide chat bot information.
  • ForumConfig - DTO class to provide forum information.
  • ChannelConfig - DTO class to provide live chat channel information.
  • DomainConfig - DTO class to provide domain information.

To embed your chat bot you can either use the SDKConnection directly, or use the WebChatbotListener to link the API to an HTML form in your webpage. Using WebChatbotListener is the easiest solution, the following code demonstrates how to create a form and link it using JavaScript.

Example embedded chat bot using JavaScript and HTML

Try it out now live

The above script was included in this page to enable you to talk with Paphus.


Speak Disconnect

So that's it, you should now be able to embed your bot on your website or blog using JavaScript.

Friday, May 16, 2014

Embedding your live chat channel on your own website

With Paphus Live Chat you can embed your live chat channels on your own website. It is quite easy to embed a channel, and only takes a few lines of HTML code. You can embed a channel to provide help or service for your website, or to connect with people on your blog.

The embedding HTML code can be copied from your channel's Embed page under Admin.

The simplest solution is to embed a channel inside your webpage using an iframe. Here is some simple code to embed the LIVE CHAT libre chat room in an iframe.

Code to embed a channel in a iframe

The embed tab provides 5 different embedding options. You just need to select the embed option and click "Get Code" to see the results. You can also make up your own option using your own code, or modifying the generated code.

Another option is to put a button or link on your website that open the channel in another window. This can be done using a little Java Script code.

Code to popup live chat in a window

This code will produce the following:

So that's it, you should now be able to embed your channel on your website or blog.

The Paphus Live Chat SDK

The Paphus Live Chat SDK is a Software Development Kit that makes it simple to add live chat, chat bots, forums and chatrooms to your own mobile application or website.

The SDK currently provides two components. The first is a Java Connection API that makes it easy to access Paphus Live Chat from a Java environment such as Android, or a Java web server. The second component is a set of Android activities that you can add to your own Android app, or copy/customize in your own app.

The SDK is developed under Project Libre an open source project hosted on GitHub
https://github.com/paphus/Project-Libre

Connection API

You can create a connection to the Paphus Live Chat server using the SDKConnection class. You need to pass your connection Credentials, which includes your application ID. You can obtain an application from the Paphus Live Chat website, from your user details page.

SDKConnection connection =
        new SDKConnection(new PaphusCredential("12345");

The SDK includes a set of data objects that represent the Paphus Live Chat object model.
The data objects are in the com.paphus.sdk.config package, and include the following,

  • UserConfig - Defines a user's credentials and info.
  • BrowseConfig - Defines a search query criteria.
  • ChannelConfig - Defines a live chat channel's details.
  • InstanceConfig - Defines a bot's details.
  • ForumConfig - Defines a forum's details.
  • ForumPostConfig - Defines a forum post.
  • DomainConfig - Defines a domain's details.
  • ChatConfig - Input for chat bot messaging.
  • VoiceConfig - Defines a chat bot's voice.
  • ChatResponse - Response for chat bot messaging.
  • ContentConfig - Defines a tag/category request.

Users

The API allows you to connect a user, or create a new user.

Use the connect() API to connect a user, the user's details will be returned, or an error message if the connect fails. The returned user details will not include the password, but will include a token, that can be used in place of the password. After connecting a connection, all subsequent requests will use the user credentials, until you call disconnect().

UserConfig user = new UserConfig();
user.user = "test";
user.password = "password";
user = connection.connect(user);

Use the create() API to create a new user. A user id and password are required. You can also pass the user's name, email, bio, and other details. The user details are returned, with a token in place of the password.

UserConfig user = new UserConfig();
user.user = "test";
user.password = "password";
user.name = "Test Account";
user.email = "test@test.com";
user = connection.create(user);

Bots

The API allows you to browse bots, get a bot's details, and chat with a bot.

The browse() API is used to browse or search the set of channels in the domain.

BrowseConfig browse = new BrowseConfig();
browse.type = "Bot";
browse.typeFilter= "Public";
browse.tag= "cool";
browse.sort = "name";
List bots = connection.browse(browse);

The fetch() API is used to get a bot's details.

InstanceConfig bot = new InstanceConfig();
bot.id = "12345";
bot = connection.fetch(bot);

The chat() API is used to chat with a bot.

ChatConfig chat = new ChatConfig();
chat.instance = "12345";
chat.message = "Hello bot";
ChatResponse response = connection.chat(chat);

Live Chat

The API allows you to browse channels, and get channel details.

The browse() API is used to browse or search the set of channels in the domain.

BrowseConfig browse = new BrowseConfig();
browse.type = "Channel";
browse.typeFilter= "Public";
browse.tag= "cool";
browse.sort = "name";
List channels = connection.browse(browse);

The fetch() API is used to get a channel's details.

ChannelConfig channel = new ChannelConfig();
channel.id = "12345";
channel = connection.fetch(channel);

The LiveChatConnection class is used to chat in a channel. It can be created using the openLiveChat() API on the SDKConnection class. You must pass the ChannelConfig with its id set, and an implementation of LiveChatListener that will receive the chat messages. Once you have a connection established, you can send and receive messages.

ChannelConfig channel = new ChannelConfig();
channel.id = "12345";
LiveChatConnection livechat = connection.openLiveChat(channel, myListener);
livechat.sendMessage("Hello World");

Android Activities

The SDK includes a set of Android activities you can reuse, or modify in your own app. The MainActivity contains the SDKConnection and some shared data, so you will need to include it even if not using the activity. The bot activities include, ChooseBotActivity, InstanceActivity, BrowseActivity, and ChatActivity. The live chat activities include, ChooseChannelActivity, ChannelActivity, ChannelBrowseActivity, and LiveChatActivity.

Here is an example of launching a bot InstanceActivity.

MainActivity.current = new MainActivity();
InstanceConfig config = new InstanceConfig();
config.id = "12345";
HttpAction action = new HttpFetchAction(this, config);
action.execute();

Note, because of the way Android does its packaging, you will need to search/replace the "com.paphus.sdk.activity.R" import with your own application's unique package. This will resolve the generated R class dependencies.

You can use the SDK to access any of your content on Paphus Live Chat.

Thursday, May 15, 2014

The Paphus Live Chat 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 Paphus Live Chat 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

  • http://www.paphuslivechat.com/rest/livechat/create-user
  • http://www.paphuslivechat.com/rest/livechat/check-user
  • http://www.paphuslivechat.com/rest/livechat/get-channels
  • http://www.paphuslivechat.com/rest/livechat/check-channel

create-user

The create-user API creates a new user, and returns the user's details.

URI: http://www.paphuslivechat.com/rest/livechat/create-user
Parameters: application, user, password, hint, name, showName, email, website, bio

XML POST Example

check-user

The check-user API validates a user, and returns the user's details.

URI: http://www.paphuslivechat.com/rest/livechat/check-user
Parameters: application, user, password, token

Parameters

applicationREQUIRED: The application ID. You can obtain an application ID from your user details page on the LIVE CHAT libre website.
userREQUIRED: The ID of the user.
passwordREQUIRED: The password of the user. A token can also be used.
tokenREQUIRED: The token of the user. A token can be obtained through check-user, and is valid until reset.

XML POST Example

get-channels

The get-channels API queries the details for all channels matching the criteria.

URI: http://www.paphuslivechat.com/rest/livechat/get-channels
Parameters: application, user, password, token, type, tag, category, sort, typeFilter, filter.

XML POST Example

check-channel

The check-channel API validates that a channel ID or name exists, and returns the channel's details.

URI: http://www.paphuslivechat.com/rest/livechat/check-channel
Parameters: application, user, password, token, id, name

Parameters

applicationREQUIRED: The application ID.
userOPTIONAL: The ID of the user. The user must be registered with FORUMS libre. If not passed the user will be anonymous. The user is required if the forum is private.
passwordOPTIONAL: The password of the user. A token can also be used.
tokenOPTIONAL: The token of the user. A token can be obtained through check-user, and is valid until reset.
idREQUIRED: The ID of the channel to validate. The channel's name can also be used, but the ID is better as it is guaranteed to be unique.
nameREQUIRED: The name of the channel to validate. The channel's ID can also be used.

XML POST Example

Web Socket API

The web socket API uses web sockets to communicate with the LIVE CHAT 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 LIVE CHAT 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.

Paphus Live Chat for Android

You can create, access, and chat on your live chat channels from your Android phone or device.

The Paphus Live Chat app can be downloaded from Google Play, here, or search for Paphus Live Chat on Google Play from your Android phone or device.

Sign In

Sign In. Your sign in is remembered until you sign out, so you only need to sign in once.

Browse

Browse public channels, or your own personal channels. Browse allows filtering and sorting of channels, and remembers the last bot you accessed.

Chat

Chat live directly from your phone or device.

Forums, Bots, and Domains

The Paphus Live Chat app also provides forums, and chat bots.
You can also access any channels your create from the Android app from the web interface. The web interface allows additional administrative features for configuring your channel.

How to create your own live chat channel in 10 clicks

Paphus Live Chat provides commercial hosted live chat channels, chat bots, chat rooms, and forums. You can create your own live chat channel, chat room, or forum and link or embed it on your own website or mobile app.

To create a commercial live chat channel you must first click Sign Up for an account. Accounts start at just 99 cents per month, and range from Basic hosted accounts, to Dedicated hosting. You can also license the Paphus Live Chat software to install on your own machines.

When you create an account you will get your own Domain. A domain is an isolated space where you can create your own live chat channels, chat bots, and forums.

The Browse page lets your browse the live chat channel categories and shows the featured channels. There are public and private channels. A public channel can be accessed by anyone, a private channel can only be accessed by the user who created it and the users they grant access to. You can administer your channel users from the Admin page. You can also add an automated chat bot agent to monitor, or service your channel from the Admin page.

Live chat channels can be configured in two different modes, One On One, and Chat Room.

Live Chat

One On One is an online call center style configuration where users only get to chat with an operator. When a user connects they are queued for the next available operator. When an operator or administrator connects they can see the connected users, and can chat with the other operators. They can accept the first user in the queue, or can 'private' a specific user.



Chat Room

Chat Room is a channel where all users can see and chat with all other connected users. Users can also private other users to engage in a private one on one chat session. Administrators also have the option of booting users.

Chat Bots

Both type of channels can be configured with an automated chat bot agent. The bot will service the channel and chat with the users. For a One On One channel, the user is free to chat with the bot at anytime, such as when all operators are busy, or no operators are online. Adding a chat bot to your channel can help you reduce your call center staffing requirements, and improve your customer response time. Chat bots work 24x7, so you can still service your online call center when no operators are available.

For a Chat Room the chat bot will take part in the discussion. In Chat Room mode, the chat bots are configured to only answer questions that they know the answer to, or that are directed to them. Users can private the chat bot like any other user, and administrators can boot the bot if they choose.

The channel bot is configured from the Admin page. You can select any of the bots that you have created, or create a new bot. You can monitor and administer the bot the same as any of your bots. The bot can be configured in two modes.

  • Listen Only - The bot will only monitor the channel conversation, and will learn responses from the operators or users. This is a good way to train your bot.
  • Answer and Listen - The bot will both answer questions, and learn from operators and users.

You can access your live chat channels embedded link from its channel page. You can use this link to embed your channel on your own website. You can also add live chat to your own mobile app using the Paphus Live Chat web API or Android SDK.

Announcing Paphus Live Chat - commercial live chat, chat bot, chatroom, and forum hosting

Announcing the new website Paphus Live Chat from Paphus Solutions. Paphus Live Chat provides commercial live chat, chat bot, chatroom, and forum services. Paphus Live Chat makes is easy to embed live chat on your own website to provide live customer service, technical support, sales, or information. Paphus Live Chat provides a perfect customer service solution for e-Commerce websites, information technology products, and more.

www.paphuslivechat.com


Are you a small business that does not have the resources to provide 24x7 live chat? Or a big corporation that wants to reduce its customer service costs? Paphus Live Chat provides state of the art live chat automation agents (chat bots), that can be connected to service a live chat channel when no operators are available.

The Paphus Live Chat website provides an administration console that makes it easy to view your chat logs and monitor your channel. You can create both call center one-on-one live chat channels, and chat rooms. You can create both public and private channels that require user authentication.

Paphus Live Chat also supports embeddable forums. Forums let your users ask and search for questions and answers.

Paphus Live Chat provides a mobile application and SDK for Android, and a web API.

Paphus Live Chat offers commercial hosting starting from $0.99 USD per month. Dedicated hosting, private hosting, and licensing of the software is also available. Live chat integration and chat bot development services are also available from Paphus Solutions.

Have any questions? Chat live now with Paphus Solutions.

Chat Now

Friday, March 14, 2014

Announcing LIVE CHAT libre! - free live chat hosting

Announcing the new website LIVE CHAT libre! from Paphus Solutions. LIVE CHAT libre provides a free live chat service for personal, academic, or commercial applications. LIVE CHAT libre channels can be easily embedded on your own website to provide live customer service, technical support, sales, or information. LIVE CHAT libre provides a perfect customer service solution for e-Commerce websites, information technology products, open source projects and more.

www.livechatlibre.com

Are you a small business that does not have the resources to provide 24x7 live chat? Or a big corporation that wants to reduce its customer service costs? LIVE CHAT libre provides state of the art live chat automation agents (chat bots), that can be connected to service a live chat channel when no operators are available.

The LIVE CHAT libre website provides an administration console that makes it easy to view your chat logs and monitor your channel. You can create both call center one-on-one live chat channels, and chat rooms. You can create both public and private channels that require user authentication.

LIVE CHAT libre also supports embeddable forums. Forums let your users ask and search for questions and answers.

LIVE CHAT libre provides a mobile application for Android, and a web API.

The LIVE CHAT libre services are also provided commercially through Paphus Chat. Paphus Chat offers commercial hosting starting from $0.99 USD per month. A customized Android APK application is provided as part of the service. This allows you to provide access to your chat service to mobile users. Dedicated hosting, private hosting, and licensing of the software is also available.

Have any questions? Chat live now with Paphus Solutions.

Chat Now