API - get list of conversations

Hi,

I am trying to get the list of conversations via API. I tried the following URL with GET request:

http://[ip]/api/conversations http://[ip]:5005/api/conversations https://[ip]/api/conversations https://[ip]:5005/api/conversations http://[ip]:5005/conversations https://[ip]:5005/conversations

None is working. Please advise.

Are you running local mode? If so, rasa x will be running on 5002, so

http://[ip]:5002/conversations

Should do it.

Otherwise on a deployed mode, https:/[ip]/api/conversations is what you want. You’ll need to be authenticated with a bearer token though, or you’ll get an unauthenticated error.

Hi Ella, thanks for ur answer. Using local mode, i already tried the following without success:

http://[ip]:5002/conversations

in parallel with:

  • rasa x / rasa run actions.
  • rasa x --enable-api / rasa run actions.
  • rasa run --enable-api / rasa run actions.

None of these worked.

Kindly find below the URL error:

waf@waf-AHV:~/Desktop$ curl -XGET http://192.168.214.166:5005/conversations

⚠️ 404 — Not Found html { font-family: sans-serif } h2 { color: #888; } .tb-wrapper p { margin: 0 } .frame-border { margin: 1rem } .frame-line > * { padding: 0.3rem 0.6rem } .frame-line { margin-bottom: 0.3rem } .frame-code { font-size: 16px; padding-left: 4ch } .tb-wrapper { border: 1px solid #eee } .tb-header { background: #eee; padding: 0.3rem; font-weight: bold } .frame-descriptor { background: #e2eafb; font-size: 14px }

⚠️ 404 — Not Found

Requested URL /conversations not found waf@waf-AHV:~/Desktop$ curl -XGET http://localhost:5005/conversations ⚠️ 404 — Not Found html { font-family: sans-serif } h2 { color: #888; } .tb-wrapper p { margin: 0 } .frame-border { margin: 1rem } .frame-line > * { padding: 0.3rem 0.6rem } .frame-line { margin-bottom: 0.3rem } .frame-code { font-size: 16px; padding-left: 4ch } .tb-wrapper { border: 1px solid #eee } .tb-header { background: #eee; padding: 0.3rem; font-weight: bold } .frame-descriptor { background: #e2eafb; font-size: 14px }

⚠️ 404 — Not Found

Requested URL /conversations not found

We don’t want to give access to Rasa X GUI, so we need to build a web app for listing the conversations with their content (once clicked on conversation sender…).

I can take a look to make sure the URLs are right (i notice that yoy’re still hitting port 5005?)

However I’m more concerned with your setup.

We don’t want to give access to Rasa X GUI, so we need to build a web app for listing the conversations with their content (once clicked on conversation sender…).

Can you elaborate on this setup? Who are you not giving access to the GUI? And if you’re going to be running the bot in production, I would highly recommend you run your bot in server mode instead of in local mode.

We are using local mode for development, and server for production.

The workflow will be: customers <=> bot <=> technical support.

The customers will chat with the bot using web widget.

Since we don’t want to give Rasa X GIU access to technical support, we will develop a small web app for listing the conversations per sender or session, and allow agents to intervene at anytime or when the customer requests a handoff.

We didn’t pay attention the port 5002.

waf@waf-AHV:~/Desktop/fyp-chatbot$ curl -XGET http://localhost:5002/conversations <!doctype html>Rasa X

So now i have to save it in HTML page, and relate it to the above required web files (JS…)?

any update? How can we use the below HTML result? Do we use it as normal HTML file, and link the below JS files to rasa x IP/path? or we shouldn’t get such result?

<!doctype html>Rasa X

anybody please?

Hey Paul.

I don’t think you can get a list of conversations via API but you can query the tracker store if it’s stored in a database. In a local installation, the tracker store is defined in endpoints.yml. For example:

tracker_store:
    type: SQL
    dialect: "mysql"
    url: "localhost"
    db: "tracker_store"
    username:  "rasa"
    password:  "rasa"

So what you can do is query the database:

SELECT DISTINCT sender_id FROM `events`

after enabling API on local mode: rasa x --enable-api --cors “*” --port 5005

I could send message to Rasa x, and test different API functions, but i still can’t get the messages itself (ex hi…, not events/intents…). The idea is to exchange messages/conversation between bot and human (custom messaging web portal).

http://192.168.214.166:5005/conversations/6b6dc043c3f94ed39522c96447156d60/tracker

any help would be highly appreciated. If i try to manipulate the data field in DB, the conversation is getting corrupted. I want to list the conversations and show the messages of each conversation only (messages exchanged between customer and support on handoff, nothing else, no intents/entities/actions…). If i can’t do it from API, please give me an example on the right format of data field to include a message only. Thank you.

1 Like

i parsed the data field from Rasa database.

Hi @ChrisRahme I have deployed Rasa in Kubernetes (not using Rasa X or any helm installation). I am persisting my rasa data outside my custom rasa container and using it in a deployment yaml. I’m able to connect things properly and bot is also responding. Now, the thing is that my endpoints.yml also tracker store enabled with mysql, but the problem is that I’ve given db credentials as plain text in this endpoints.yml. I want to make this endpoints.yml take data from secrets defined in my cluster. How will that be possible? Please guide me