Search code examples
javascripthtmlbotframeworkazure-qna-maker

Is it Possible to Query QnAMaker using URL Parameters?


I'm not sure is this is possible. I need to query QnAMaker for answers using a URL Parameter and return the result on the Virtual Assistant chat window (e.g. https://BotFrameWorkURL.html?searchTerm=Password%20Reset.


Solution

  • If I'm understanding you correctly...if you're asking if you could use only the URL parameter and no request, body, then the answer would be "no". The API expects a POST request and to receive a payload body that contains at least the "question"

    See QnA Maker documentation on the generate answer API here.

    URL Format: https://{QnA-Maker-endpoint}/knowledgebases/{knowledge-base-ID}/generateAnswer

    JSON body example:

    1. Simplest:
    {
        "question": "How much wood would a woodchuck chuk?"
    }
    
    1. With more QnA Options:
    {
        "question": "qna maker and luis",
        "top": 6,
        "isTest": true,
        "scoreThreshold": 30,
        "rankerType": "" // values: QuestionOnly
        "strictFilters": [
        {
            "name": "category",
            "value": "api"
        }],
        "userId": "sd53lsY="
    }