Botpress API for sending messages into Ongoing Cha...
# 🤝help
b
Hi @crooked-van-25152 I want to send message to a ongoing chat (active conversation) through a third party platform. Does botpress provide any api for this ? In the api docs i see this endpoint : https://botpress.com/docs/api-documentation/#create-message POST /v1/chat/messages can you tell if this endpoint is able to send message a to the user in an ongoing chat Your guidance on achieving this would be greatly appreciated.
let me elaborate my use case : I am trying to create a chatbot that will help users to reset there password. so for this flow will be the bot will raise a ticket for 'pass reset' in a platform and that platform will trigger some another flow for doing pass reset. Now once this pass is reset I want to send this new password and confirmation from this platform to the ongoing chat of the user and the chatbot.
l
@big-butcher-14899 hi! The most straightforward way to do it is to have the endpoint that you send the "reset password" request to, return a confirmation in the response once the reset is performed. This way you could parse the response data using the same code that sends the request, put it into a workflow/session variable and display in a response template. If that is for some reason not possible, I suspect that you could achieve updating a conversation using webhooks (https://botpress.com/docs/cloud/channels/webhook/) with conversation id in the payload, but I'm not certain of that. Quick question out of curiosity: how do you authenticate users before resetting their password?
b
the challenge here is the bot is only raising a ticket in a platform and it disconnects there, from there the automation handles that request. So, I cannot get the response directly to the bot. Once that ticket is resolved by those platforms we need to send the new password with confirmation to that existing conversation of the bot and the user.
we will authenticate the user beforehand by sending otp to registered phone
f
Can you send it to them via email?
How much time does it take from the user creating a ticket to them getting a new password?
b
actually its the email password that we gonna reset for the user so user will not have access to his email.
it hardly takes 5-7 secs for this process
f
Then you can try and do what Nick said
l
@big-butcher-14899 , given how important it is to deliver this information and how unreliable a browser session is, I would strongly advise you to send the update and all the relevant information (maybe a one-time link with the password or whatever your process is) via SMS.
216 Views