Ocp-Apim-Subscription-Key is not working

Ambi Tamber 41 Reputation points

I am trying to use Bing News api v7.
I got the key from Bing resources > name of resource > Keys and Endpoint.

When I try to get information from this endpoint, I am getting this.

{"error":{"code":"401","message":"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."}}

Bing News Search
Bing News Search
A Bing service that supports searching for news and get comprehensive results.
43 questions
{count} votes

Accepted answer
  1. romungi-MSFT 41,861 Reputation points Microsoft Employee

    @Ambi Tamber To use the news API please use the following in your request URL and the subscription key should be part of the header instead of the query parameter. You can run a GET query with the following details:


    Header for this request should be your key:

    Ocp-Apim-Subscription-Key: <your_key>

    P.S: I have updated the post to remove your keys.

1 additional answer

Sort by: Most helpful
  1. Ambi Tamber 41 Reputation points

    This is working for me. Thanks.

    0 comments No comments