HITL On pause progamatically

Am using botpress 11.9.4 with
$ node -v
v12.2.0

$ npm -v
6.9.0

$ yarn -v
1.16.0

Question:
I want to implement a functionality where the bot pauses and sends a message to a human agent . Then the human finds the conversation thread in hitl and talks to the user.

how i vision this on my bot should be, maybe if the user clicks a button (talk to agent ) , or type (talk to agent ) … the conversation is paused, the agent is alerted so they can talk to the user.

I dont know how to pause the conversation. I would want you to show me how you did this with a small example/screenshots ( for a newbie in botpress/javascript)

I will appreciate any help

@DigiSenseiZim @rndlaine any luck?

Hi,

have you checked to tutorial for the hitl module?

-> https://botpress.io/docs/tutorials/hitl/

In short, you need to enable de hitl module and send an HTTP query to this end point:

POST /mod/hitl/sessions/{$id}/pause

There is an axios instance in the botpress sdk object which you can use like this:

bp.axios.post(/mod/hitl/sessions/${id}/pause)

you can look the axios package here: https://www.npmjs.com/package/axios

hope this information helps you!

François