New Bing Search API Key returns 401 permission denied

587 views Asked by At

I have two new Bing API keys. I've placed them in my code in the correct places:

 function getSubscriptionKey() {
   var key = "c8a8bbc87015441295d7df8e70ed8e9d"; //     var key = retrieveValue(API_KEY_COOKIE);
    while (key.length !== 32) {
    key = prompt("Enter Bing Search API subscription key:", "").trim();
   }
   // always set the cookie in order to update the expiration date
   storeValue(API_KEY_COOKIE, key);
   return key;
 }  

A search returns:

Error HTTP Status 401 PermissionDenied error: [object Object]

The search engine worked fine before. Bing may have changed their API.

Previously working codepen here:

https://codepen.io/Teeke/project/editor/XvymoQ

0

There are 0 answers