RE: Roger/Dave HTTP GET API, Yahoo Pipes
Hi Roger, I looked into adding a forms style GET API, and it was pretty easy to add. I am in the process of documenting the API, but the basics is here,
HTTP FORM GET API
<a href="http://www.botlibre.com/rest/botlibre/form-chat">http://www.botlibre.com/rest/botlibre/form-chat</a>
<a href="http://www.botlibre.com/rest/botlibre/form-check-instance">http://www.botlibre.com/rest/botlibre/form-check-instance</a>
<a href="http://www.botlibre.com/rest/botlibre/form-check-user">http://www.botlibre.com/rest/botlibre/form-check-user</a>
<a href="http://www.botlibre.com/rest/botlibre/form-get-all-instances">http://www.botlibre.com/rest/botlibre/form-get-all-instances</a>
form-chat
Description - Receives a chat message and returns the chat bot’s reply as an XML document.
URI
<a href="http://www.botlibre.com/rest/botlibre/form-chat">http://www.botlibre.com/rest/botlibre/form-chat</a>
Parameters - application, instance, user, , token, conversation, message, emote, correction, offensive, disconnect, includeQuestion.
application - OPTIONAL: The application ID. If not passed, the application will be anonymous.
instance - REQUIRED: The ID of the bot to chat with. The bot’s name can also be used, but the ID is better as it is guaranteed to be unique.
user - OPTIONAL: The ID of the user who is sending the message. The user must be registered with BOT libre. If not passed the user will be anonymous. The user is required if the bot is private. The user/password are only required on the first message.
password - OPTIONAL: The password of the user who is sending the message. A token can also be used.
token - OPTIONAL: The token of the user who is sending the message. A token can be obtained through check-user, and is valid until reset.
conversation - OPTIONAL: The conversation ID for the current conversation. This must not be passed on the first message, but will be returned by the response, and should be used for all subsequent messages in the conversation.
message - OPTIONAL: The chat message to send to the bot. The message can be omitted if you wish the bot to start the conversation (if the bot has a greeting set). The message must be encoded in the URI.
emote - OPTIONAL: A emotion to tag the message with. This is one of LOVE, LIKE, DISLIKE, HATE,
RAGE, ANGER, CALM, SERENE, ECSTATIC, HAPPY, SAD, CRYING, PANIC, AFRAID, CONFIDENT, COURAGEOUS, SURPRISE, BORED, LAUGHTER, SERIOUS.
correction - OPTIONAL: A boolean that defines the chat message is a correction to the bot’s last answer.
offensive - OPTIONAL: A boolean that defines the bot’s last answer as offensive. The message will be flagged for the bot’s administrator to review.
disconnect - OPTIONAL: A boolean that defines the end of the conversation.
includeQuestion - OPTIONAL: A boolean that indicates the question should be included in the response.
Example
<a href="http://www.botlibre.com/rest/botlibre/form-chat?instance=165&message=what+is+a+chat+bot">http://www.botlibre.com/rest/botlibre/form-chat?instance=165&message=what+is+a+chat+bot</a>
Example Result
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<response conversation="6" avatar="avatars/botlibre_819-857117-image.jpg">
<message>A chatter robot, <a href="http://www.chatbots.org/chatterbot" class="term">chatterbot</a>, chatbot, or chat bot is a computer program designed to simulate an intelligent conversation with one or more human users via auditory or textual methods, primarily for engaging in small talk.</message>
</response>