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 Anonymous Talk API can solve that issue!
This API will allow you to request creation of an end-user client_name on the Pandorabots 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 an active conversation, but eventually be cleared out of memory after a idle period. By using a client_name
retrieved from the Anonymous Talk API, your end-user’s predicates will persist beyond this limited scope.
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. A sample cURL command using the public botkey would be:
curl -v -X POST 'https://api.pandorabots.com/atalk?botkey=BOTKEY&input=INPUT'
Sending the HTTP request without the client_name parameter will indicate 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": "hhhh-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 hhhh
is the host service name, XXX
is your APP_ID
and NNNN
is a numeric starting with 0000, and increments by 1 after each new request.
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 Pandorabots generated 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. This is a lifetime limit of 10,000 per account. Please contact us if you need more than this.
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).