title: Microsoft QnA Maker API Error Resource Not Found
body: <p>I am sending a POST request using JS for Micosoft QnA Maker API. But it is returning a JSON file with Error Resourse Not Found</p>
  
  <pre><code>{ "error": { "code": "ResourceNotFound", "message": "The requested resource was not found." } }
  </code></pre>
  
  <p>Although I am doing everything correct according to the API still getting the same error.</p>
  
  <p>I am using the code in JS as shown below:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  $(function() {
      var params = {
  
  "question": "is qna maker free?",
  "top": 3
      };
  
      $.ajax({
          url: "https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/XXXX/generateAnswer?" + $.param(params),
          beforeSend: function(xhrObj){
              // Request headers
              xhrObj.setRequestHeader("Content-Type","application/json");
              xhrObj.setRequestHeader("Ocp-Apim-Subscription-Key","XXXX");
          },
          type: "POST",
          // Request body
          data: "{body}",
      })
      .done(function(data) {
          alert("success");
      })
      .fail(function() {
          alert("error");
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>This code is returning <strong>alert("error")</strong> and also showing the following message in console:</p>
  
  <pre><code>westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/XXXX/generateAnswer?question=is+qna+maker+free%3F&amp;top=3:1 POST https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/XXXX/generateAnswer?question=is+qna+maker+free%3F&amp;top=3 400 (Bad Request)
  </code></pre>
  
  <p>I am referring to this <a href="https://westus.dev.cognitive.microsoft.com/docs/services/58994a073d9e04097c7ba6fe/operations/58994a073d9e041ad42d9ba9" rel="nofollow noreferrer">link</a> </p>
  
  <p>I have seen that there Response 400 says that "Argument question is not specified." But I have specified the question.
  What's wrong with my code? I am quite sure that there's must be something wrong with this in my code.</p>
  
  <pre><code>"question": "is qna maker free?",
  "top": 3
  </code></pre>
  
  <p>When I visit this <a href="https://westus.api.cognitive.microsoft.com/qnamaker/v2.0/knowledgebases/XXXX/generateAnswer?Zepo" rel="nofollow noreferrer">link</a> </p>
  
  <p>It also shows the same JSON file with the error.</p>