PUT/bot/{app_id}/{botname}/{file-kind}/{filename}

Upload a bot file (AIML, set, substitution, map)

Implementation Notes

Upload bot personality files to your bot. Files must be named with only lowercase letters and numbers with one of the following extensions:

AIML: Extension - .aiml, file-kind - file

Sets: Extension - .set, file-kind - set

Maps: Extension - .map, file-kind - map

Substitutions: Extension - .substitution, file-kind - substitution

The system will overwrite existing files with the file being uploaded.

If the request is malformed because the file name is invalid or malformed JSON for non-AIML files, a 400 error is returned. For malformed file-kind, a 404 error is returned. For invalid file or botname, a 412 error is returned.

If Active Doc spec is not working with this API, please use the following curl command examples:

GET/bot/{app_id}/{botname}/verify

Compile a bot

Implementation Notes

A bot personality is created by uploading AIML and other file types to Pandorabots. The files must compile correctly in order for the bot to run. By issuing a call to this API, Pandorabots will compile the bot, updating any changes that have been made to the files.

Compiling the bot makes its most recent version available for talk. A 400 error means that we were unable to compile your bot (you should check your files for syntax issues) or the botname was not found.

You can see any thrown errors in the results field of the returned JSON object:

Parameters

POST/talk/{app_id}/{botname}

Talk to a bot

Implementation Notes

Start or continue a conversation with the bot using the Talk API. Pandorabots will return a new session ID if not included in the call. Use the session ID returned to group interactions together. If you do not provide a client name, Pandorabots will assume client is your application and all predicates and variable information will be associated with your application. Predicates assigned to clientname only persist during an active conversation and are flushed after a certain idle period.

NOTE: If you send multiple sentences to your bot in a single input, the API response will include multiple bot responses.

See Anonymous Talk API for details on how you can maintain persistent predicates for your end-users.

Malformed requests such as exceeding size of input or invalid clientname returns 400 error code. Error code 412 is returned if the bot is not compiled or does not exist. Error code 429 is returned if your application has reached maximum plan API call limit.

The response array will contain one element (response) for each sentence you input to the bot. You can configure which characters delimit a new sentence in the input by modifying the sentence-splitters property in your bot’s property file.

Parameters

The name of the bot. Format required is 3-64 characters in length and only numbers or lower-case letters [0-9][a-z]

path

string

input

(required)

Message to be sent to the bot. This can contain multiple sentences. Currently the limit is 500 characters.

query

string

client_name

Identifies your application’s end user. You can assign each of your end users a unique client_name. This will allow you to set predicates and other variable information that is specific to an individual. Format required is 3-64 characters in length and only numbers or lower-case letters [0-9][a-z]

query

string

sessionid

Session ID generated by Pandorabots. This allows the application to group individual conversations into a collection as needed. If not included in the call, Pandorabots will issue a new session ID. (4-byte integer type)

query

string

recent

If true, the system will not signal an error if the bot is uncompiled, and will instead look for a previous version of the bot that is available.

query

string

user_key

(required)

Your application’s user key.

query

string

POST/talk/{app_id}/{botname}

Debug a bot conversation

Implementation Notes

Use these tools to test/debug/trace bot categories.

Malformed requests such as exceeding size of input or invalid clientname returns 400 error code. Error code 412 is returned if the bot is not compiled or does not exist.

Parameters

The name of the bot. Format required is 3-64 characters in length and only numbers or lower-case letters [0-9][a-z]

path

string

input

(required)

Message to be sent to the bot. This can contain multiple sentences. Currently the limit is 500 characters.

query

string

client_name

Identifies your application’s end user. You can assign each of your end users a unique client_name. This will allow you to set predicates and other variable information that is specific to an individual. Format required is 3-64 characters in length and only numbers or lower-case letters [0-9][a-z]

query

string

sessionid

Session ID generated by Pandorabots. This allows the application to group individual conversations into a collection. While testing your bot, not including this parameter, Pandorabots will issue a new session ID. (4-byte integer type)

query

string

that

For debugging purposes, you can specify a ‘that’ with the input that supersedes the existing that in bot memory.

query

string

topic

For debugging purposes, you can specify a ‘topic’ with the input that supersedes the existing topic in bot memory.

query

string

extra

Return extra conversation information. If true, input, pattern, that, topic, filename, and template associated with the pattern matched are returned in addition to response and sessionid.

query

string

reset

Reset the bot memory. If true, all predicate values in the bot will be discarded, and the user can talk to the bot as if it is the first time

query

string

trace

Include trace data in the response. If true, the system will generate AIML trace information for the input. Trace data includes pattern matched, filename, input, template for all recursion levels. NOTE: for security reasons, trace does not work with client_name.

query

string

reload

If true, the system will force a reload of the bot into memory. This can be useful if you’ve recently uploaded an AIML file, recompiled your bot and want access to your bot’s latest changes.

query

string

recent

If true, the system will not signal an error if the bot is uncompiled, and will instead look for a previous version of the bot that is available.

query

string

user_key

(required)

Your application’s user key.

query

string

POST/atalk/{app_id}/{botname}

Anonymous Talk

Implementation Notes

Start a conversation with the bot using the Anonymous Talk API. This method will allow you to request creation of an end-user client_name that can maintain persistent predicates per end-user talking to your bot. If client_name is NOT sent in the request, then Pandorabots will create a end-user client_name and return it in the response. Similar to the Talk to Bot API, Pandorabots will also return a new session ID if not included in the call. Use the session ID returned to group interactions together.

In addition to bot response and session ID, the HTTP response will include a new end-user client_name in the following format:
aiaas-XXX-user-nnnn, where XXX is your app_ID and nnnn is numeric starting with 0000 and incrementing after each request.

Malformed requests such as exceeding size of input or unknown end-user client_name returns 400 error code. Error code 412 is returned if the bot is not compiled or does not exist. Error code 429 is returned if your application has reached maximum plan API call limit.

Parameters

The name of the bot. Format required is 3-64 characters in length and only numbers or lower-case letters [0-9][a-z]

path

string

input

(required)

Message to be sent to the bot. This can contain multiple sentences. Currently the limit is 500 characters.

query

string

client_name

Leave blank to request Pandorabots to create a client_name which will support persistent predicates. Including a valid client_name in this parameter will work in the same way that Talk to Bot API but with persistent predicates. It is recommended to use this API only to create an end-user client_name, and then use normal Talk to Bot API to continue conversation with the bot.

query

string

sessionid

Session ID generated by Pandorabots. This allows the application to group individual conversations into a collection as needed. If not included in the call, Pandorabots will issue a new session ID. (4-byte integer type)

query

string

recent

If true, the system will not signal an error if the bot is uncompiled, and will instead look for a previous version of the bot that is available.