Does Bing News Search API's C# SDK support querying a private endpoint using an App Id?

108 Views Asked by At

The quick-start sample documentation shows how one can query the public endpoint using a subscription key.

But say I have a private Bing News API endpoint and an AppId generated that identifies me - Can I use the C# SDK to call this endpoint using my AppId? Or would I be forced to call it as a REST API by creating a HttpWebRequest?

Is there something that allows the private API provider to generate subscription keys for their consumers?

1

There are 1 best solutions below

0
Jason Pan On BEST ANSWER

As far as I know, only the subscription key can be used to define the client in the SDK. Such as var client = new NewsSearchClient(new ApiKeyServiceClientCredentials(key));.

Currently, private sites such as https://pa***2.cognitiveservices.azure.com and key are not supported to define clients. It is recommended to raise a support ticket on portal to confirm this.

If you need to use C# code to implement the bing search function, it is recommended to use HttpClient and C# code to send http requests.

You can use HttpHelper in my sample code.