QnA Maker V4.0

QnA Maker REST API V4.0

Download Knowledgebase

Download the knowledgebase.

Select the testing console in the region where you created your resource:

Open API testing console

Request URL

Request parameters

string

Knowledgebase id

string

Specifies whether environment is Test or Prod.

Request headers

string
Subscription key which provides access to this API. Found in your Cognitive Services accounts.

Request body

Response 200

Collection of all Q-A in the knowledgebase.

{
  "qnaDocuments": [
    {
      "id": 1,
      "answer": "You can change the default message if you use the QnAMakerDialog. See this for details: https://docs.botframework.com/en-us/azure-bot-service/templates/qnamaker/#navtitle",
      "source": "Custom Editorial",
      "questions": [
        "How can I change the default message from QnA Maker?"
      ],
      "metadata": []
    },
    {
      "id": 2,
      "answer": "You can use our REST apis to manage your KB. See here for details: https://westus.dev.cognitive.microsoft.com/docs/services/58994a073d9e04097c7ba6fe/operations/58994a073d9e041ad42d9baa",
      "source": "Custom Editorial",
      "questions": [
        "How do I programmatically update my KB?"
      ],
      "metadata": [
        {
          "name": "category",
          "value": "api"
        }
      ]
    },
    {
      "id": 3,
      "answer": "QnA Maker provides an FAQ data source that you can query from your bot or application. Although developers will find this useful, content owners will especially benefit from this tool. QnA Maker is a completely no-code way of managing the content that powers your bot or application.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Who is the target audience for the QnA Maker tool?"
      ],
      "metadata": []
    },
    {
      "id": 4,
      "answer": "<p>You can sign in with your <a href=\"https://account.microsoft.com/account\" data-linktype=\"external\">Microsoft account</a></p>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How do I sign in to the QnA Maker portal?"
      ],
      "metadata": []
    },
    {
      "id": 5,
      "answer": "<p>Yes, currently the QnA Maker tool is free to use. However, usage is metered for each account. For more information, see <a href=\"https://qnamaker.ai/Documentation/Authentication\" data-linktype=\"external\">Authentication and subscription keys</a></p>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Is the QnA Maker Service free?"
      ],
      "metadata": []
    },
    {
      "id": 6,
      "answer": "It’s possible that the tool can't auto-extract some question-and-answer (QnA) content from valid FAQ URLs. In such cases, you can paste the QnA content in a .txt file and see if the tool can ingest it. Alternately, you can editorially add content to your knowledge base.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "My URLs have valid FAQ content, but the tool cannot extract them. Why not?"
      ],
      "metadata": []
    },
    {
      "id": 7,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>The tool supports the following file formats for ingestion:</p><ul><li>.tsv: QnA contained in the format Question(tab)Answer.</li><li>.txt, .docx, .pdf: QnA contained as regular FAQ content--that is, a sequence of questions and answers.</li></ul></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "What format does the tool expect for the file content?"
      ],
      "metadata": []
    },
    {
      "id": 8,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>No, you don’t. However, QnA Maker is offered as one of several templates in <a href=\"https://azure.microsoft.com/services/bot-service/\" data-linktype=\"external\">Azure Bot Service</a>. Bot Service enables rapid intelligent bot development through Microsoft Bot Framework, and it runs in a serverless environment. </p><p>Bots scale based on demand. You pay for only the resources that you consume.</p></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Do I need to use Bot Framework in order to use QnA Maker?"
      ],
      "metadata": []
    },
    {
      "id": 9,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>QnAMaker provides a REST endpoint that you can call from any bot code. However, if you'd like a quick way to set up a QnAMaker bot, you can use the <a href=\"https://docs.microsoft.com/bot-framework/bot-service-overview-introduction\" data-linktype=\"external\">Azure Bot Service</a>. Follow the instructions <a href=\"https://docs.microsoft.com/bot-framework/bot-service-quickstart\" data-linktype=\"external\">here</a> and choose the \"Question and Answer\" bot template. Once the bot is created, you will need to do the following steps to complete setup.</p><ol><li>In Azure portal, open the newly created Web App Bot resource.</li><li>Click on \"Application Settings\" and in the App Settings list, add QnASubscriptionKey and QnAKnowledgebaseId. The corresponding values can be obtained from the KB Settings page in <a href=\"http://qnamaker.ai/\" data-linktype=\"external\">http://qnamaker.ai</a>.</li><li>The QnAMaker-enabled Azure bot service app is now ready to use. To try it out click on \"Test in Web Chat\" to chat with your QnA bot.</li></ol></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How can I create a bot with QnAMaker?"
      ],
      "metadata": []
    },
    {
      "id": 10,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>Follow these steps to embed the QnA Maker service as a web-chat control in your website:</p><ol><li>Create your knowledge base from the <a href=\"https://qnamaker.ai/\" data-linktype=\"external\">QnA Maker webpage</a>.</li><li>Create your bot as shown in <a href=\"https://docs.botframework.com/en-us/azure-bots/build/first-bot/#navtitle\" data-linktype=\"external\">Create a bot with the Azure Bot Service</a>. </li><li>Look for the Question and Answer bot template.</li><li>Enable the bot on the Web Chat channel. Get the embed keys.</li><li>Embed the web chat as shown in <a href=\"https://docs.botframework.com/en-us/support/embed-chat-control2/#navtitle\" data-linktype=\"external\">Connect a bot to Web Chat</a>.</li></ol></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How do I embed the QnA Maker service in my website?"
      ],
      "metadata": []
    },
    {
      "id": 11,
      "answer": "Currently, the QnA Maker tool handles semi-structured FAQ content and certain types of product manuals. Eventually, the vision is to be able to answer questions from unstructured content as well.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "What is the roadmap of QnA Maker?"
      ],
      "metadata": []
    },
    {
      "id": 12,
      "answer": "Currently, the limit is a 20-MB knowledge base.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How large a knowledge base can I create?"
      ],
      "metadata": []
    },
    {
      "id": 13,
      "answer": "Every edit operation, whether in a table update, test, or settings, needs to be saved before it can be published. Be sure to select the Save and retrain button after every edit operation.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "The updates that I made to my knowledge base are not reflected on publish. Why not?"
      ],
      "metadata": []
    },
    {
      "id": 14,
      "answer": "The upload feature expects the file to be formatted as tab-separated columns of question, answer, and source.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Why can’t I replace my knowledge base with the upload feature?"
      ],
      "metadata": []
    },
    {
      "id": 15,
      "answer": "You should refresh your subscription keys if you suspect that they have been compromised. Any requests with your subscription key will count toward your quota.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "When should I refresh my subscription keys?"
      ],
      "metadata": []
    },
    {
      "id": 16,
      "answer": "The QnA Maker tool stores all knowledge base content in Azure Storage. You need a combination of knowledge base ID and subscription key to access the knowledge base. The tool doesn't use knowledge base content for any other purpose.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How safe is the data in my knowledge base?"
      ],
      "metadata": []
    },
    {
      "id": 17,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>The knowledge base supports Markdown. However, the auto-extraction from URLs has limited HTML-to-Markdown conversion capability. If you want to use full-fledged Markdown, you can modify your content directly in the table, or upload a knowledge base with the rich content.</p><p>Multimedia, such as images and videos, is not supported at this time.</p></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Does the knowledge base support rich data or multimedia?"
      ],
      "metadata": []
    },
    {
      "id": 18,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>The QnA Maker tool ingests and matches data in UTF-16 encoding. Any language should work as is. But, we have extensively tested the relevance of the service for English only.</p><p>If you have content from multiple languages, be sure to create a separate service for each language.</p></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Does QnA Maker support non-English languages?"
      ],
      "metadata": []
    },
    {
      "id": 19,
      "answer": "The chat logs are tab-separated files, with the query and the frequency as the columns. Frequency is the number of times that the same query was seen. The file is sorted in descending order of frequency. Select questions from the downloaded file that you want to test, and then upload it to see what responses the system returned for them.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "What is the format of the downloaded chat logs?"
      ],
      "metadata": []
    },
    {
      "id": 20,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>The new service doesn't include the test URL. The reason is that all calls are metered, as part of Cognitive Services. Because the test URL exposed the subscription key and the knowledge base ID, it was a security risk. </p><p>However, it's still easy to share your knowledge base and use it in chats. Check out the Azure Bot Service template for the <a href=\"https://blog.botframework.com/2016/12/13/More-Ways-to-Make-Smart-Bots/\" data-linktype=\"external\">Question and Answer bot</a>. You can create the Question and Answer bot in Skype in a few clicks, and then share it with anyone.</p></main>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Where is the test web-chat URL from the old portal? How do I share my knowledge base with others now?"
      ],
      "metadata": []
    },
    {
      "id": 21,
      "answer": "<p>Current transaction limits are 10 calls per minute and 10,000 calls per month. If you require higher limits, a free premium tier is available with limits of 1,000 calls per minute and 500,000 calls per month. To sign up for this option, fill in the <a href=\"https://forms.office.com/Pages/ResponsePage.aspx?id=v4j5cvGGr0GRqy180BHbR_yh9o_uvdhPnJy8sn_XBGRUMktKRFNYME1VUkVRRVkwV0hDWUNWMVVNRC4u\" data-linktype=\"external\">request form</a>. Note that these tiers are subject to change when the tool goes to general availability.</p>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How can I increase the transaction limits?"
      ],
      "metadata": []
    },
    {
      "id": 22,
      "answer": "<p>If QnA Maker doesn't match any of the questions, it shows a default \"Sorry, no match found\" message. You can change this default message in the code-behind by using the <code>QnAMakerDialog</code> object. For more information, see <a href=\"https://docs.botframework.com/en-us/azure-bot-service/templates/qnamaker/#navtitle\" data-linktype=\"external\">Create a bot using the Question and Answer template</a>.</p>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How can I change the default message when no good match is found?"
      ],
      "metadata": []
    },
    {
      "id": 23,
      "answer": "The tool parses only public URLs and does not support authenticated data sources at this time. Alternately, you can download the file and use the file-upload option to extract questions and answers.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "Why is my SharePoint link not getting extracted?"
      ],
      "metadata": []
    },
    {
      "id": 24,
      "answer": "<p>There is no direct integration of LUIS with QnA Maker. But, in your bot code, you can use LUIS and QnA Maker together. <a href=\"https://github.com/Microsoft/BotBuilder-CognitiveServices/tree/master/Node/samples/QnAMaker/QnAWithLUIS\" data-linktype=\"external\">View a sample bot</a></p>",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How can I integrate LUIS with QnA Maker?"
      ],
      "metadata": []
    },
    {
      "id": 25,
      "answer": "QnAMaker is currently in free Preview and does not have support SLAs. If you want to report an issue or provide feedback, you do so on UserVoice through the \"Feedback\" button in the top navigation bar.",
      "source": "https://docs.microsoft.com/en-in/azure/cognitive-services/qnamaker/faqs",
      "questions": [
        "How can I report issues or contact support for QnAMaker?"
      ],
      "metadata": []
    },
    {
      "id": 26,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>While the Conversation User Interface (CUI) is upon us, at this point few developers have the expertise and tools needed to create new conversational experiences or enable existing applications and services with a conversational interface their users can enjoy. We have created the Bot Framework to make it easier for developers to build and connect great bots to users, wherever they converse, including on Microsoft's premier channels.</p><h2 id=\"channels\">Channels</h2></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "Why did Microsoft develop the Bot Framework?"
      ],
      "metadata": []
    },
    {
      "id": 27,
      "answer": "<p>We plan on making continuous improvements to the Bot Framework, including additional channels, but cannot provide a schedule at this time.If you would like a specific channel added to the framework, <a href=\"https://docs.microsoft.com/en-us/bot-framework/bot-service-resources-links-help\" data-linktype=\"relative-path\">let us know</a>.</p>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "When will you add more conversation experiences to the Bot Framework?"
      ],
      "metadata": []
    },
    {
      "id": 28,
      "answer": "<p>We have not provided a general mechanism for developers to add new channels to Bot Framework, but you can connect your bot to your app via the <a href=\"http://docs.botframework.com/en-us/restapi/directline/\" data-linktype=\"external\">Direct Line API</a>. If you are a developer of a communication channel and would like to work with us to enable your channel in the Bot Framework <a href=\"https://docs.microsoft.com/en-us/bot-framework/bot-service-resources-links-help\" data-linktype=\"relative-path\">we’d love to hear from you</a>.</p>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "I have a communication channel I’d like to be configurable with Bot Framework. Can I work with Microsoft to do that?"
      ],
      "metadata": []
    },
    {
      "id": 29,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>The Bot Framework is designed to build, connect, and deploy high quality, responsive, performant and scalable bots for Skype and many other channels. The SDK can be used to create text/sms, image, button and card-capable bots (which constitute the majority of bot interactions today across conversation experiences) as well as bot interactions which are Skype-specific such as rich audio and video experiences.</p><p>If you already have a great bot and would like to reach the Skype audience, your bot can easily be connected to Skype (or any supported channel) via the Bot Builder for REST API (provided it has an internet-accessible REST endpoint).</p><h2 id=\"security-and-privacy\">Security and Privacy</h2></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "If I want to create a bot for Skype, what tools and services should I use?"
      ],
      "metadata": []
    },
    {
      "id": 30,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>Each bot is its own service, and developers of these services are required to provide Terms of Service and Privacy Statements per their Developer Code of Conduct. You can access this information from the bot’s card in the Bot Directory.</p><p>to provide the I/O service, the Bot Framework transmits your message and message content (including your ID), from the chat service you used to the bot.</p></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "Do the bots registered with the Bot Framework collect personal information? If yes, how can I be sure the data is safe and secure? What about privacy?"
      ],
      "metadata": []
    },
    {
      "id": 31,
      "answer": "Users have a way to report a misbehaving bot via the bot’s contact card in the directory. Developers must abide by Microsoft terms of service to participate in the service.",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "How do you ban or remove bots from the service?"
      ],
      "metadata": []
    },
    {
      "id": 32,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>You'll need to whitelist the following URLs in your corporate firewall:</p><ul><li>login.botframework.com (Bot authentication)</li><li>login.microsoftonline.com (Bot authentication)</li><li>westus.api.cognitive.microsoft.com (for Luis.ai NLP integration)</li><li>state.botframework.com (Bot state storage for prototyping)</li><li>cortanabfchanneleastus.azurewebsites.net (Cortana channel)</li><li>cortanabfchannelwestus.azurewebsites.net (Cortana Channel)</li><li>*.botFramework.com (channels)</li></ul><h2 id=\"rate-limiting\">Rate limiting</h2></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "Which specific URLs do I need to whitelist in my corporate firewall to access bot services?"
      ],
      "metadata": []
    },
    {
      "id": 33,
      "answer": "The Bot Framework service must protect itself and its customers against abusive call patterns (e.g., denial of service attack), so that no single bot can adversely affect the performance of other bots. To achieve this kind of protection, we’ve added rate limits (also known as throttling) to all endpoints. By enforcing a rate limit, we can restrict the frequency with which a bot can make a specific call. For example: with rate limiting enabled, if a bot wanted to post a large number of activities, it would have to space them out over a time period. Please note that the purpose of rate-limiting is not to cap the total volume for a bot. It is designed to prevent abuse of the conversational infrastructure that does not follow human conversation patterns.",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "What is rate limiting?"
      ],
      "metadata": []
    },
    {
      "id": 34,
      "answer": "It is unlikely you’ll experience rate limiting, even at high volume. Most rate limiting would only occur due to bulk sending of activities (from a bot or from a client), extreme load testing, or a bug. When a request is throttled, an HTTP 429 (Too Many Requests) response is returned along with a Retry-After header indicating the amount of time (in seconds) to wait before retrying the request would succeed. You can collect this information by enabling analytics for your bot via Azure Application Insights. Or, you can add code in your bot to log messages. ",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "How will I know if I’m impacted?"
      ],
      "metadata": []
    },
    {
      "id": 35,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>It can happen if:</p><ul><li>a bot sends messages too frequently</li><li>a client of a bot sends messages too frequently</li><li>Direct Line clients request a new Web Socket too frequently</li></ul></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "How does rate limiting occur?"
      ],
      "metadata": []
    },
    {
      "id": 36,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>We’re continuously tuning the rate limits to make them as lenient as possible while at the same time protecting our service and our users. Because thresholds will occasionally change, we aren’t publishing the numbers at this time. If you are impacted by rate limiting, feel free to reach out to us at <a href=\"mailto://bf-reports@microsoft.com\" data-linktype=\"external\">bf-reports@microsoft.com</a>.</p><h2 id=\"related-services\">Related Services</h2></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "What are the rate limits?"
      ],
      "metadata": []
    },
    {
      "id": 37,
      "answer": "<p>Both the Bot Framework and <a href=\"http://www.microsoft.com/cognitive\" data-linktype=\"external\">Cognitive Services</a> are new capabilities introduced at <a href=\"http://build.microsoft.com/\" data-linktype=\"external\">Microsoft Build 2016</a> that will also be integrated into Cortana Intelligence Suite at GA. Both these services are built from years of research and use in popular Microsoft products. These capabilities combined with ‘Cortana Intelligence’ enable every organization to take advantage of the power of data, the cloud and intelligence to build their own intelligent systems that unlock new opportunities, increase their speed of business and lead the industries in which they serve their customers.</p>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "How does the Bot Framework relate to Cognitive Services?"
      ],
      "metadata": []
    },
    {
      "id": 38,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>Cortana Intelligence is a fully managed Big Data, Advanced Analytics and Intelligence suite that transforms your data into intelligent action.It is a comprehensive suite that brings together technologies founded upon years of research and innovation throughout Microsoft (spanning advanced analytics, machine learning, big data storage and processing in the cloud) and:</p><ul><li>Allows you to collect, manage and store all your data that can seamlessly and cost effectively grow over time in a scalable and secure way.</li><li>Provides easy and actionable analytics powered by the cloud that allow you to predict, prescribe and automate decision making for the most demanding problems.</li><li>Enables intelligent systems through cognitive services and agents that allow you to see, hear, interpret and understand the world around you in more contextual and natural ways.</li></ul><p>With Cortana Intelligence, we hope to help our enterprise customers unlock new opportunities, increase their speed of business and be leaders in their industries.</p></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "What is Cortana Intelligence?"
      ],
      "metadata": []
    },
    {
      "id": 39,
      "answer": "<main id=\"main\" role=\"main\" class=\"content\" ms.cmpgrp=\"content\" data-bi-name=\"content\" lang=\"en-us\" dir=\"ltr\"><p>Direct Line is a REST API that allows you to add your bot into your service, mobile app, or webpage.</p><p>You can write a client for the Direct Line API in any language. Simply code to the <a href=\"http://docs.botframework.com/en-us/restapi/directline/\" data-linktype=\"external\">Direct Line protocol</a>, generate a secret in the Direct Line configuration page, and talk to your bot from wherever your code lives.</p><p>Direct Line is suitable for:</p><ul><li>Mobile apps on iOS, Android, and Windows Phone, and others</li><li>Desktop applications on Windows, OSX, and more</li><li>Webpages where you need more customization than the <a href=\"https://docs.microsoft.com/en-us/bot-framework/bot-service-channel-connect-webchat\" data-linktype=\"relative-path\">embeddable Web Chat channel</a> offers</li><li>Service-to-service applications</li></ul></main>",
      "source": "https://docs.microsoft.com/en-us/bot-framework/resources-bot-framework-faq",
      "questions": [
        "What is the Direct Line channel?"
      ],
      "metadata": []
    }
  ]
}

Response 400

{
  "error": {
    "code": "BadArgument",
    "message": "Invalid input. See details.",
    "details": [
      {
        "code": "ValidationFailure",
        "message": "'Name' should not be empty.",
        "target": "Name"
      }
    ]
  }
}

Response 401

{
  "error": {
    "code": "Unauthorized",
    "message": "Access denied due to invalid subscription key. Make sure you are subscribed to an API you are trying to call and provide the right key."
  }
}

Response 403

{
  "error": {
    "code": "Forbidden",
    "message": "You do not have permissions to view the requested resource."
  }
}

Response 404

{
  "error": {
    "code": "NotFound",
    "message": "The requested knowledge base is not found."
  }
}

Response 500

{
  "error": {
    "code": "Unspecified",
    "message": "Something happened. Please retry after some time."
  }
}

Code samples

@ECHO OFF

curl -v -X GET "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna"
-H "Ocp-Apim-Subscription-Key: {subscription key}"

--data-ascii "{body}" 
using System;
using System.Net.Http.Headers;
using System.Text;
using System.Net.Http;
using System.Web;

namespace CSHttpClientSample
{
    static class Program
    {
        static void Main()
        {
            MakeRequest();
            Console.WriteLine("Hit ENTER to exit...");
            Console.ReadLine();
        }
        
        static async void MakeRequest()
        {
            var client = new HttpClient();
            var queryString = HttpUtility.ParseQueryString(string.Empty);

            // Request headers
            client.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", "{subscription key}");

            var uri = "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna?" + queryString;

            var response = await client.GetAsync(uri);
        }
    }
}	
// // This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
import java.net.URI;
import org.apache.http.HttpEntity;
import org.apache.http.HttpResponse;
import org.apache.http.client.HttpClient;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.impl.client.HttpClients;
import org.apache.http.util.EntityUtils;

public class JavaSample 
{
    public static void main(String[] args) 
    {
        HttpClient httpclient = HttpClients.createDefault();

        try
        {
            URIBuilder builder = new URIBuilder("https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna");


            URI uri = builder.build();
            HttpGet request = new HttpGet(uri);
            request.setHeader("Ocp-Apim-Subscription-Key", "{subscription key}");


            // Request body
            StringEntity reqEntity = new StringEntity("{body}");
            request.setEntity(reqEntity);

            HttpResponse response = httpclient.execute(request);
            HttpEntity entity = response.getEntity();

            if (entity != null) 
            {
                System.out.println(EntityUtils.toString(entity));
            }
        }
        catch (Exception e)
        {
            System.out.println(e.getMessage());
        }
    }
}

<!DOCTYPE html>
<html>
<head>
    <title>JSSample</title>
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
</head>
<body>

<script type="text/javascript">
    $(function() {
        var params = {
            // Request parameters
        };
      
        $.ajax({
            url: "https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna?" + $.param(params),
            beforeSend: function(xhrObj){
                // Request headers
                xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","{subscription key}");
            },
            type: "GET",
            // Request body
            data: "{body}",
        })
        .done(function(data) {
            alert("success");
        })
        .fail(function() {
            alert("error");
        });
    });
</script>
</body>
</html>
#import <Foundation/Foundation.h>

int main(int argc, const char * argv[])
{
    NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
    
    NSString* path = @"https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna";
    NSArray* array = @[
                         // Request parameters
                         @"entities=true",
                      ];
    
    NSString* string = [array componentsJoinedByString:@"&"];
    path = [path stringByAppendingFormat:@"?%@", string];

    NSLog(@"%@", path);

    NSMutableURLRequest* _request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:path]];
    [_request setHTTPMethod:@"GET"];
    // Request headers
    [_request setValue:@"{subscription key}" forHTTPHeaderField:@"Ocp-Apim-Subscription-Key"];
    // Request body
    [_request setHTTPBody:[@"{body}" dataUsingEncoding:NSUTF8StringEncoding]];
    
    NSURLResponse *response = nil;
    NSError *error = nil;
    NSData* _connectionData = [NSURLConnection sendSynchronousRequest:_request returningResponse:&response error:&error];

    if (nil != error)
    {
        NSLog(@"Error: %@", error);
    }
    else
    {
        NSError* error = nil;
        NSMutableDictionary* json = nil;
        NSString* dataString = [[NSString alloc] initWithData:_connectionData encoding:NSUTF8StringEncoding];
        NSLog(@"%@", dataString);
        
        if (nil != _connectionData)
        {
            json = [NSJSONSerialization JSONObjectWithData:_connectionData options:NSJSONReadingMutableContainers error:&error];
        }
        
        if (error || !json)
        {
            NSLog(@"Could not parse loaded json with error:%@", error);
        }
        
        NSLog(@"%@", json);
        _connectionData = nil;
    }
    
    [pool drain];

    return 0;
}
<?php
// This sample uses the Apache HTTP client from HTTP Components (http://hc.apache.org/httpcomponents-client-ga/)
require_once 'HTTP/Request2.php';

$request = new Http_Request2('https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna');
$url = $request->getUrl();

$headers = array(
    // Request headers
    'Ocp-Apim-Subscription-Key' => '{subscription key}',
);

$request->setHeader($headers);

$parameters = array(
    // Request parameters
);

$url->setQueryVariables($parameters);

$request->setMethod(HTTP_Request2::METHOD_GET);

// Request body
$request->setBody("{body}");

try
{
    $response = $request->send();
    echo $response->getBody();
}
catch (HttpException $ex)
{
    echo $ex;
}

?>
########### Python 2.7 #############
import httplib, urllib, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.urlencode({
})

try:
    conn = httplib.HTTPSConnection('westus.api.cognitive.microsoft.com')
    conn.request("GET", "/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################

########### Python 3.2 #############
import http.client, urllib.request, urllib.parse, urllib.error, base64

headers = {
    # Request headers
    'Ocp-Apim-Subscription-Key': '{subscription key}',
}

params = urllib.parse.urlencode({
})

try:
    conn = http.client.HTTPSConnection('westus.api.cognitive.microsoft.com')
    conn.request("GET", "/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna?%s" % params, "{body}", headers)
    response = conn.getresponse()
    data = response.read()
    print(data)
    conn.close()
except Exception as e:
    print("[Errno {0}] {1}".format(e.errno, e.strerror))

####################################
require 'net/http'

uri = URI('https://westus.api.cognitive.microsoft.com/qnamaker/v4.0/knowledgebases/{kbId}/{environment}/qna')
uri.query = URI.encode_www_form({
})

request = Net::HTTP::Get.new(uri.request_uri)
# Request headers
request['Ocp-Apim-Subscription-Key'] = '{subscription key}'
# Request body
request.body = "{body}"

response = Net::HTTP.start(uri.host, uri.port, :use_ssl => uri.scheme == 'https') do |http|
    http.request(request)
end

puts response.body