Getting 401 unauthorized error and not able to integrate with ready SDK for JAVA.

Ankita Kanzariya 0 Reputation points
2024-02-01T12:25:51.2033333+00:00

Hello, I am trying to integrate Bing News Search API with a Java 8 project. I tried a couple of ways to integrate the API. With All other ways, I am getting 401 unauthorized error. I have checked the endpoint and the key both of them are correct. And I also am not able to integrate with ready SDK. Please let me know if more information is required. Thanks in advance!

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

1 answer

Sort by: Most helpful
  1. romungi-MSFT 43,656 Reputation points Microsoft Employee
    2024-02-02T09:26:19.39+00:00

    @Ankita Kanzariya With the SDK packages, I think this is a known issue. After the migration of the search APIs from cognitive services to bing there is no update to use the latest version of the APIs, this causes the SDK samples to fail. With the REST API though, you should be able to get a response with a call to the correct endpoint along with its keys in the header. Could you please add sample code that was used when you used REST API? Thanks!!

    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

    0 comments No comments