Bot is not authorized to create messages as an int...
# 🤝help
w
When I am calling https://api.botpress.cloud/v1/chat/messages API, I am getting an error **Request**: { "conversationId": "xxxxxxxxx-414d-xxxx-823d-xxxxxxxxxxx", "payload": { "type": "text", "text": "hi" }, "tags": { "webchat:id": "xxxxxxxxx-f895-xxxx-a7e2-xxxxxxxxxxx" }, "userId": "xxxxxxxxxx-e21a-xxxx-bded-xxxxxxxxxx", "type": "text", "direction": "incoming" } Response { "code": 403, "type": "Forbidden", "message": "Bot "<< Bot ID >>" is not authorized to create messages as an integration" } Anybody know why I am getting this? I tried to google it and took ChatGPT help as well. It suggest that there should be an option to provide permissions to bot. ["canCreateMessages", "canCreateMessagesAsIntegration"]. But for now, those APIs are not available in botpress cloud. Is this correct ? If so, is there any tentative plan when it'll be available? And is there any alternative till this API is available?
f
Hello, this is because only integrations (not bots by themselves) are allowed to proactively initiate a conversation with a user. So, you'd need to use an integration that implements conversation creation (or create a custom one that does). You can use our Whatsapp integration as reference, which is open source: https://github.com/botpress/botpress/blob/master/integrations/whatsapp/src/index.ts
k
@famous-zoo-73118 Is this something you are planning to implement in the future?
f
@kind-terabyte-49312 this is already available, but only through integrations
k
Thanks for your quick reply. So does it work for webchat? If so - could you provide some more guidance? Running into the same error as @worried-businessperson-99933
f
Forgot to clarify: Only through integrations that allow conversation creation
You can find those by going to the hub: https://app.botpress.dev/hub
And using the ones that indicate they support creating conversations
m
@famous-zoo-73118 how would i add a custom integration to my bot? I don't see a menu item for "custom" on the page to add an integration (https://app.botpress.cloud/hub)
f
Right now the process isn't fully documented yet and is considered a bit more advanced as it's done outside of the Studio using our Botpress CLI tool and requires some web development knowledge. However, we're working on what will be like a "bridge" integration that will be publicly available as an integration for all bots and which you'll be able to use to do this kind of this much more easily. We don't have a firm timeline for this but please stay tuned for our announcements in the coming months.
m
we are trying to make a framework buy / build decision. we love your product and would like to use it. however, we would need to create our own custom integration for it to meet our needs. would this be something that our technical team could work with you all on in the near term - or would you recommend waiting for a few months?
we have a tech team - and would prefer not to build ourselves. let me know if this could be something to explore further @famous-zoo-73118 -thank you!
to be clear - build a bot framework. we are happy to build an integration
i found your integration instructions. i will try there
f
@many-helmet-8927 Absolutely, if you can let me know what kind of requirements your team has and what are the reasons for building this integration, I can see how we can help and what would be the recommended course of action.
m
@famous-zoo-73118 one more question for you - Can I create a custom integration for a Bot that I develop with Cloud Studio? I want to build the bot using the UX
the instructions are only for a bot developed in the SDK
i ask because it says i can use the integration with any bot in my workspace - but i cannot add it to a new bot in my workspace via the UI
f
Right now it's not possible to install a custom integration for a bot created through the Studio (only for code-only bots as you point out) but I'll check this with the team to see where in the roadmap is this feature sitting at the moment, and will get back to you.
@many-helmet-8927 Please disregard my previous statement, we do have a way now to install a custom integration into a Studio-created bot. To do so after you have deployed your custom integration using the Botpress CLI, just go the Botpress Cloud dashboard, then click on the button with a gear icon in the top right corner of the screen, then click on "Integrations", then go to your custom integration and click on the "Install" button that will appear in the top right corner. It looks like this:

https://cdn.discordapp.com/attachments/1137831763587108925/1141069283586232480/image.png

124 Views