forked from tillkolter/instibot
-
Notifications
You must be signed in to change notification settings - Fork 0
API Reference
rosner edited this page Jun 29, 2011
·
4 revisions
Consider the server runs locally and on port 8080 the base url is http://localhost:8080/api/
. The root resource is bot
.
To get the bot talk to you, you first need to request a user id.
GET bot/user_credentials/{bot_id}
bot_id is the pandorabots ID of the bot
$ curl -i http://localhost:8080/api/bot/user_credentials/fe64a45a9e346bff
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(7.2.2.v20101205)
{"expiration_date":"2011-07-09T14:11:26.000+02:00","path":"/pandora","user_id":"c84ea15ebb045f74"}
GET respond/{bot_id}/{user_id}/{user_input}
bot_id is the pandorabots ID of the bot
user_id the user id you got through requesting it from the API (see above)
user_input The question of the user.
$ curl -i http://localhost:8080/api/bot/respond/fe64a45a9e346bff/c84ea15ebb045f74/Hello
HTTP/1.1 200 OK
Content-Type: application/json
Transfer-Encoding: chunked
Server: Jetty(7.2.2.v20101205)
{"responses":[{"answer":"Worueber haben wir gesprochen?","question":"Hello"}]}