QnA from another server/app

Is it possible to call the QnA from another server/app.

Depending on what you mean by “Call the QnA”.

If what you mean is “Can I get answer from QnA” by API, then yes just use the Converse API

If what you mean is Can I create/read/update/delete QNA items from another app by API, the answer is also yes but it’s not documented. Let me detail that for you. First of all you’ll need to authenticate to get your auth token. I assume you know how to do this, if not let me know I’ll detail this as well.

First of, every module that exposes an API is accessible through the module url scheme
http://{YOUR_BP_HOST}/api/v1/bots/{BOT_ID}/mod/{MODULE_NAME}

Let’s say we I host my botpress deployment on hellobp.com and I have a bot with id hey, qna module base url woud be http://hellobp.com/api/v1/bots/hey/mod/qna

Now if we look at the code here you’ll see that you can CRUD QnA items with the /questions and /questions:id routes.

Let me know if you need more info.
Thaks

Thanks i’ve mean “Can I get answer from QnA” by API”
I gonna check the Converse API

Thanks

Hi @EFF i’ve been trying to work with the Converse API but i’m enabled to find a way to send a message without authentication and receive the complete API response…

Using converse api (unauthenticated and authenticated) will give you the same response as what you would get when chatting. This means that your flow will still be executed, you won’t get a direct qna response. Authenticated calls will simply give you the whole payload including NLU extraction, but that won’t give you a direct qna answer.

What is your usecase exactly ? Are you using / would you like to use botpress to query QNA directly without having dialog engine to execute flows etc. ?

Thats exactly the usecase. We have in one side our user chating with the bot with a react native application and on the other side we have another app (website - forum like), the user do not chat with the bot, but we will like to query the QNA to check what user would like when they’re posting something.

Got it. While this isn’t supported, we might provide this soon as I’ve seen this quite often. I’ve seen other members of the community create a dedicated bot handling QNAs without any flows. This way when you use converse api, you make sure you get answers only from QNA module.

Hope this helps