HITL issue - Can not pause by API Call

Hi all,

Need help on HITL pausing.

I am a beginner, neither a dev… I am just playing around trying to understand some basic use cases.

I am testing the pause a conversation using API call by simply following the tutorial here… https://botpress.com/docs/developers/tutorials

I want that my conversation to pause automatically at the end of a particular flow. However, just can not make the conversation pause, although my API call request returns a “success”

Can someone help?

NB I am testing it on the latest version of botpress and using the emulator on an unpublished test bot…

Thanks a lot
Pascal

Hi @PascalDrim,

You should be POSTing to
http://localhost:3000/api/v1/bots/{{botId}}/mod/hitl/sessions/{{sessionId}}/pause
to pause a selected conversation, no body needed. Note that requires an authorization: Bearer, which token you can get from /api/v1/auth/login/basic/default, with parameters email and password for the super admin login.

Let me know if you have further issues testing the API calls.

Happy Building :robot:

By the way… just wanted to share how to pause conversation when using botpress on premise

const pauseConversation = async (action = ‘pause’) => {
const config = await bp.http.getAxiosConfigForBot(event.botId, { localUrl: true })
const sessionId = await bp.dialog.createId(event)

const { data } = await axios.post(`/mod/hitl/channel/${event.channel}/user/${event.target}/${action}`, {}, config)

}

return pauseConversation(args.action)

Thanks to @kevin21 :wink:

1 Like