Skip to content
This repository has been archived by the owner on Nov 29, 2018. It is now read-only.

Commit

Permalink
Updated CSS for full width image in page-content.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pandorabots authored and Pandorabots committed Mar 14, 2016
1 parent 7291d05 commit b323c0c
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 34 deletions.
42 changes: 42 additions & 0 deletions _articles/managing-end-users-with-a-talk.md
@@ -0,0 +1,42 @@
---
layout: default
title: Using the Anonymous Talk API
---

# "Managing" End-Users with Anonymous Talk API

If you've developed your bot to remember conversational elements, and you'd like to have it remember them past an active session with your end-users but don't want to maintain any kind of end-user management, the new Anonymous Talk API can solve that issue!

This API will allow you to request creation of an end-user client_name on the AIaaS platform that will maintain persistent predicates for anonymous end-users talking to your bot(s), without you having to maintain end-user profiles on your website or application.

Previously, you had the option to pass in a `client_name` to identify your end-users. This would allow predicates to persist throughout a given chat session, but eventually fall out of the bot's memory. By using a `client_name` retrieved from the Anonymous Talk API, your end-user's predicates will persist beyond this limited scope.

### Getting Started

The Anonymous Talk API is similar to the Talk to Bot API in that to start a talk interaction with your bot with a brand new end-user, at minimum you will need your application ID (`APP_ID`), user key (`USER_KEY`), bot name (`BOTNAME`), and input message to your bot (`INPUT`). A sample cURL command would be:

curl -v -X POST 'https://aiaas.pandorabots.com/atalk/APP_ID/BOTNAME?user_key=USER_KEY&input=INPUT'


Sending the HTTP request without the client_name parameter will indicate to AIaaS that you are requesting a new end-user account. The HTTP response will return a JSON object such as:

{ "status": "ok",
"responses": [<OUTPUT>],
"sessionid": <SESSION_ID> ,
"client_name": "aiaas-XXX-user-NNNN"
}

where `<OUTPUT>` is the bot response to the input received, `<SESSION_ID>` is a sequential number generated by Pandorabots, and client_name is an anonymous end-user client name generated by Pandorabots, where `XXX` is your `APP_ID` and `NNNN` is a numeric starting with 0000, and increments by 1 after each new request.

### Continuing the Conversation
Once an anonymous end-user `client_name` has been provided, your application should use this client_name in subsequent talk interactions (either Anonymous Talk or Talk to Bot API will work). Any predicates created in conversation with your bot will be associated with this new `client_name` and will persist indefinitely until overwritten.

Your application can save this `client_name` as an anonymous end-user either in a cookie, as a local variable in your application, or other mechanisms developed in your application.

**NOTE OF CAUTION --** When testing your application, not including a `client_name` will result in a new end-user `client_name` being created; make sure your application ONLY excludes this parameter for brand new end-users or else you may end up reaching your maximum limit on anonymous users.

### BONUS!

**Persistent Predicates for Known End-Users**

This method can also be used for known end-users. In this case, the `client_name` provided by Pandorabots should be saved in your application's database associated with your end-user's profile, and used each time your end-user talks to your bot(s).
48 changes: 14 additions & 34 deletions _deployments/browser-integration.md
Expand Up @@ -5,53 +5,33 @@ title: Browser Integration

# Browser Integration

Using the pb-html package, you can now easily deploy an application which
provides an web interface for chatting with your bot.
Using the [pb-html package](https://github.com/pandorabots/pb-html), you can now easily deploy an application which provides a web interface for chatting with your chatbot.

If you're familiar with our old system, you'll probably remember how easy this
was to to using the "Custom HTML" tab in your dashboard. But with our release of
the new API, this feature was removed to protect the credentials and usage of
your bot.
If you're familiar with the now deprecated [AIML 1.0 system](http://www.pandorabots.com/botmaster/en/home), you'll probably remember how easy it was to publish your chatbot to a webpage using the "Custom HTML" tab in your dashboard. Now our APIs available via [chatbots.io](https://developer.pandorabots.com/) allow you integrate your chatbots into any application, however the "Custom HTML" feature was removed to protect the credentials and usage of your chatbot.

The pb-html package is a simple web server that can be deployed to Heroku
with the click of a button. It comes with a slick little chat interface that
provides an easy way for users to access and chat with your bot.
The [pb-html package](https://github.com/pandorabots/pb-html) is a simple web server that can be deployed to [Heroku](https://www.heroku.com/) with the click of a button. We've also provided a reusable, customizable chat interface for end-users to access and chat with your chatbot.

![](/images/pb-html.png)

## Setup

First, sign up for an account on Heroku. Then visit the [Github repository](https://github.com/pandorabots/pb-html)
and click the "Deploy to Heroku" button. You'll be asked to provide your
Pandorabots API credentials (it's assumed you already have a plan and have
deployed a bot). Once you've clicked "Deploy for Free" and Heroku has built
and launched your app, you may visit the site and start talking to your bot.
First, sign up for an account on [Heroku](https://www.heroku.com/). Then visit the [Github repository](https://github.com/pandorabots/pb-html) and click the "Deploy to Heroku" button. You'll be asked to provide your [Pandorabots API](https://developer.pandorabots.com/) credentials (it's assumed you already have a plan and have deployed a chatbot). Once you've clicked "Deploy for Free" and Heroku has built and launched your app, you may visit the site and start talking to your chatbot.

## User management
## End-user management

Our other integrations feature Redis as a way to manage your users over time.
This works by mapping the user's phone number or username (depending on the
platform) to a unique Pandorabots "client_name", allowing the bot to remember
information about the user in future messages and conversations.
Our other integrations feature Redis as a way to manage your users over time. This works by mapping the user's phone number or username (depending on the platform) to a unique Pandorabots `client_name`, allowing the bot to remember information about the user in future messages and conversations.

With the browser, there is no phone number or username to identify the user by.
Instead, this implementation stores the client_name as a local variable, which
is cleared when the user reloads the page. In other words, the bot will remember
the user throughout the course of their conversation, but not after they have
left the interface.
With the browser, there is no phone number or username by which to identify the end-user. Instead, this implementation stores the `client_name` as a local variable, which is cleared when the user reloads the page. In other words, the chatbot will remember the user throughout the course of their conversation, but not after they have left the interface.

To mitigate this difference, you could store the client_name in a cookie so that
the user's client_name is saved even when they leave the page. A better option
might be to implement some sort of authentication of your users, so that they
can log in to a session that stores their client_name in memory. There is no
"right" way to do this - it all depends on the scope of your project!
To mitigate this difference, you could store the `client_name` in a cookie so that it is saved even when the user leaves the page. A better option might be to implement some sort of authentication of your users, so that they can log in to a session that stores their client_name in memory. There is no "right" way to do this -- it all depends on the scope of your project!

## Development

If you'd like to customize your app, or make contributions to this project,
first clone the repository. Once inside, run `npm start` to launch the app. You
can then run `npm watch` in a new terminal window to automatically build your
frontend application when changes are saved.
If you'd like to customize your app, or make contributions to this project, first clone the repository. Once inside, run `npm start` to launch the app. You can then run `npm run watch` in a new terminal window to automatically build your frontend application when changes are saved.

This project uses [ReactJS](https://facebook.github.io/react/), a Javascript library made at Facebook for the purpose of building user interfaces.

### Styling

Some base styles are provided in src/public/css/base.css. There is also a file
src/public/css/style.css provided for you to do custom styling!
src/public/css/style.css provided for you to do custom styling to the chat interface.
4 changes: 4 additions & 0 deletions css/style.css
Expand Up @@ -8,6 +8,10 @@ h1, h2, h3, h4 {
margin-top: 0px;
}

.page-content img {
width: 100%;
}

/* Use to style the logo */
.brand {
font-family: 'Comfortaa', cursive;
Expand Down
Binary file added images/pb-html.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit b323c0c

Please sign in to comment.