instedd / aida

10 stars 1 forks source link

API for Session log returns empty array on staging #278

Closed zontarian closed 6 years ago

zontarian commented 6 years ago

Hi, I was wondering, what is the expected behaviour of the session log API? I have started a conversation with a Bot, and exchanged a few messages (I am working on the staging server).

I was expecting to get these messages back by calling:

https://aida-stg.instedd.org/api/v1/bots/<BOT_ID>/sessions/<SESSION_UUID>/log?access_token=<MY_ACCESS_TOKEN>

But i get

{
  "data" : []
}

The MY_ACCESS_TOKEN is the one set in the tab Channel/Websocket while the SESSION_UUID is the UUID returned upon sending a new_session message.

Is this an error on my part, or an expected behaviour? Thanks

zontarian commented 6 years ago

Ok. Closed. the access token is the API Access token, as generated in the API page, not the one set in Channel/Websocket page.

Using this API access token I can get the log of the given session. Ie..

https://aida-stg.instedd.org/api/v1/bots/18/sessions/<SESSION UUID>/log?access_token=<API_ACCESS_TOKEN>