Class Index | File Index

Classes


Class SDKConnection


Defined in: sdk.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Connection class for a REST service connection.
Field Summary
Field Attributes Field Name and Description
 
 
 
 
 
Method Summary
Method Attributes Method Name and Description
 
avatarMessage(config, processor)
Process the avatar message and return the avatar's response.
 
browse(config, processor)
Return the list of content for the browse criteria.
 
chat(config, processor)
Process the bot chat message and return the bot's response.
 
chatSettings(config, processor)
Return the conversation's chat settings.
 
command(config, processor)
Process the bot command message and return the bot's response.
 
connect(config, processor)
Validate the user credentials (password, or token).
 
createBotAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a bot.
 
createChannelAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a chat channel.
 
createForumAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a forum.
 
createForumPost(config, processor)
Create a new forum post.
 
createReply(config, processor)
Create a reply to a forum post.
 
createUser(config, processor)
Create a new user.
 
Permanently delete the forum post with the id.
 
Disconnect from the connection.
 
fetch(config, processor)
Fetch the content details from the server.
 
fetchAllUsers(usersCSV, processor)
Return the list of user details for the comma separated values list of user ids.
 
fetchCategories(config, processor)
Return the list of categories for the type, and domain.
 
fetchForumPost(config, processor)
Fetch the forum post details for the forum post id.
 
fetchImage(image)
Fetch the URL for the image from the server.
 
fetchLink(image)
Fetch the URL for the image from the server.
 
fetchPosts(config, processor)
Return the list of forum posts for the forum browse criteria.
 
fetchTags(config, processor)
Return the list of tags for the type, and domain.
 
fetchUser(config, processor)
Fetch the user details for the user credentials.
 
fetchUsers(config, processor)
Return the users for the content.
 
fetchVoice(config, processor)
Return the bot's voice configuration.
 
flag(config)
Flag the content as offensive, a reason is required.
 
flagForumPost(config)
Flag the forum post as offensive, a reason is required.
 
flagUser(config)
Flag the user post as offensive, a reason is required.
 
GET(url, processor)
 
initAvatar(config, processor)
Initialize the bot's avatar for a chat session.
 
initChat(config, processor)
Initialize the bot's avatar for a chat session.
 
openLiveChat(channel, listener)
Connect to the live chat channel and return a LiveChatConnection.
 
POST(url, xml, processor)
 
POST_FILE(url, form, xml, processor)
 
POST_IMAGE(url, file, form, xml, processor)
 
switchDomain(config, processor)
Connect to the domain.
 
trainInstance(config)
Return the bot's voice configuration.
 
updateForumPost(config, processor)
Update the forum post.
 
updateUser(config)
Update the user details.
 
uploadForumAttachment(forum, resize, processor)
Create a new file/image/media attachment for a forum and insert the http link into the textarea.
 
uploadForumFile(file, forum, resize, form, processor)
Create a new file/image/media attachment for a forum.
 
viewUser(config, processor)
Fetch the user details for the user id.
Class Detail
SDKConnection()
Connection class for a REST service connection. The SDK connection gives you access to the Bot Libre services using a REST web API.

The services include:

  • User management (account creation, validation)
  • Bot access, chat, and administration
  • Forum access, posting, and administration
  • Live chat access, chat, and administration
  • Script, Graphic, and Domain access, and administration
Field Detail
credentials

debug

domain

error

user
Method Detail
avatarMessage(config, processor)
Process the avatar message and return the avatar's response.
Parameters:
config
processor

browse(config, processor)
Return the list of content for the browse criteria. The type defines the content type (one of Bot, Forum, Channel, Domain).
Parameters:
config
processor

chat(config, processor)
Process the bot chat message and return the bot's response. The ChatConfig should contain the conversation id if part of a conversation. If a new conversation the conversation id is returned in the response.
Parameters:
config
processor

chatSettings(config, processor)
Return the conversation's chat settings.
Parameters:
config
processor

command(config, processor)
Process the bot command message and return the bot's response. The CommandConfig should contain the conversation id if part of a conversation. If a new conversation the conversation id is returned in the response.
Parameters:
config
processor

connect(config, processor)
Validate the user credentials (password, or token). The user details are returned (with a connection token, password removed). The user credentials are soted in the connection, and used on subsequent calls. An SDKException is thrown if the connect failed.
Parameters:
config
processor

createBotAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a bot.
Parameters:
config
file
resize
form
processor

createChannelAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a chat channel.
Parameters:
config
file
resize
form
processor

createForumAttachment(config, file, resize, form, processor)
Create a new file/image/media attachment for a forum.
Parameters:
config
file
resize
form
processor

createForumPost(config, processor)
Create a new forum post. You must set the forum id for the post.
Parameters:
config
processor

createReply(config, processor)
Create a reply to a forum post. You must set the parent id for the post replying to.
Parameters:
config
processor

createUser(config, processor)
Create a new user.
Parameters:
config
processor

deleteForumPost(config)
Permanently delete the forum post with the id.
Parameters:
config

disconnect()
Disconnect from the connection. An SDKConnection does not keep a live connection, but this resets its connected user and domain.

fetch(config, processor)
Fetch the content details from the server. The id or name and domain of the object must be set.
Parameters:
config
processor

fetchAllUsers(usersCSV, processor)
Return the list of user details for the comma separated values list of user ids.
Parameters:
usersCSV
processor

fetchCategories(config, processor)
Return the list of categories for the type, and domain.
Parameters:
config
processor

fetchForumPost(config, processor)
Fetch the forum post details for the forum post id.
Parameters:
config
processor

fetchImage(image)
Fetch the URL for the image from the server.
Parameters:
image

fetchLink(image)
Fetch the URL for the image from the server.
Parameters:
image

fetchPosts(config, processor)
Return the list of forum posts for the forum browse criteria.
Parameters:
config
processor

fetchTags(config, processor)
Return the list of tags for the type, and domain.
Parameters:
config
processor

fetchUser(config, processor)
Fetch the user details for the user credentials. A token or password is required to validate the user.
Parameters:
config
processor

fetchUsers(config, processor)
Return the users for the content.
Parameters:
config
processor

fetchVoice(config, processor)
Return the bot's voice configuration.
Parameters:
config
processor

flag(config)
Flag the content as offensive, a reason is required.
Parameters:
config

flagForumPost(config)
Flag the forum post as offensive, a reason is required.
Parameters:
config

flagUser(config)
Flag the user post as offensive, a reason is required.
Parameters:
config

GET(url, processor)
Parameters:
url
processor

initAvatar(config, processor)
Initialize the bot's avatar for a chat session. This can be done before processing the first message for a quick response.
Parameters:
config
processor
Deprecated:
replaced by initChat()

initChat(config, processor)
Initialize the bot's avatar for a chat session. This can be done before processing the first message for a quick response.
Parameters:
config
processor

openLiveChat(channel, listener)
Connect to the live chat channel and return a LiveChatConnection. A LiveChatConnection is separate from an SDKConnection and uses web sockets for asynchronous communication. The listener will be notified of all messages.
Parameters:
channel
listener

POST(url, xml, processor)
Parameters:
url
xml
processor

POST_FILE(url, form, xml, processor)
Parameters:
url
form
xml
processor

POST_IMAGE(url, file, form, xml, processor)
Parameters:
url
file
form
xml
processor

switchDomain(config, processor)
Connect to the domain. A domain is an isolated content space. Any browse or query request will be specific to the domain's content.
Parameters:
config
processor

trainInstance(config)
Return the bot's voice configuration.
Parameters:
config

updateForumPost(config, processor)
Update the forum post.
Parameters:
config
processor

updateUser(config)
Update the user details. The password must be passed to allow the update.
Parameters:
config

uploadForumAttachment(forum, resize, processor)
Create a new file/image/media attachment for a forum and insert the http link into the textarea.
Parameters:
forum
resize
processor

uploadForumFile(file, forum, resize, form, processor)
Create a new file/image/media attachment for a forum.
Parameters:
file
forum
resize
form
processor

viewUser(config, processor)
Fetch the user details for the user id.
Parameters:
config
processor

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Oct 17 2017 14:11:31 GMT-0400 (EDT)