https://discord.gg/botpress logo
Is the Bot's User ID Static per Integration for AP...
# 🤝help
b
We are using the Botpress Cloud API (/v1/chat/messages) / SDK to send messages programmatically as the bot within existing conversations. To do this, the API requires the bot's userId. Our current approach involves parsing existing conversation messages to dynamically find the bot's userId (outgoing message userId). However, this runtime lookup is an overhead. We would prefer to store the bot's userId in our configuration if it is static for a given integration. Could you please confirm whether the userId representing the bot is guaranteed to be static and persistent for a specific integration instance (like for webchat -- user_xxx, whatsapp -- user_yyy)? If confirmed, we can confidently hardcode these IDs. Any official documentation regarding the persistence of these IDs would be greatly appreciated. Thanks
p
The Bot (user) id is initialized upon the bot's creation and will not change. You can actually find the bot id in the studio url. Hope this helps!
b
Hi @prehistoric-airplane-85682 thanks for the reply, but I am not talking about botId but bot user Id in the conversation which is different for each integeration. for example take a look at webchat conversation and whatsapp conversation you will find bot ( outgoing message userId ) will have say x123 id for webchat and y321 for whatsapp I think these id's get created for bot when we install/register integration, so just need confirmation if this is the case so next time when I want to create a message in conversation as a bot I can use this Id x123 and send message via API or sdk
Hi @prehistoric-airplane-85682 @orange-egg-72655 Hope you're doing great! 🙂 Just looping back on my question about the bot user ID — would love your insights when you have a moment.
p
Hi, sorry for the delay. It should be static indeed.
b
Thanks @prehistoric-airplane-85682
3 Views