1

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

RubyRube
  • 602
  • 5
  • 24
  • Are you sure the access token is valid? Currently the API returns "`Access denied due to invalid subscription key or wrong API endpoint. Make sure to provide a valid key for an active subscription and use a correct regional API endpoint for your resource.`" – NullDev Dec 06 '20 at 17:51
  • I signed up for a paid account, and just generated 2 access keys. I tried swapping their positions. I'm sure they're valid as they come from credit card approved account. – RubyRube Dec 06 '20 at 17:57

0 Answers0