Skip to content

Commit 25946f7

Browse files
authored
Merge pull request #58220 from MikeDodaro/fixLocalBusSrchQuickstarts
Fix UriBase in Local Business Search
2 parents f2290b6 + 7eb45f6 commit 25946f7

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

articles/cognitive-services/bing-local-business-search/quickstarts/local-quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The following code creates a `WebRequest`, sets the access key header, and adds
3333
// Replace the accessKey string value with your valid access key.
3434
const string accessKey = "enter key here";
3535
36-
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/localbusinesses/search";
36+
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/search";
3737
3838
const string searchTerm = "restaurant in Bellevue";
3939
// Construct the URI of the search request
@@ -73,7 +73,7 @@ namespace localSearch
7373
// Replace the accessKey string value with your valid access key.
7474
const string accessKey = "enter key here";
7575
76-
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/localbusinesses/search";
76+
const string uriBase = "https://api.cognitive.microsoft.com/bing/v7.0/search";
7777
7878
const string searchTerm = "restaurant in Bellevue";
7979
@@ -109,7 +109,7 @@ namespace localSearch
109109
{
110110
// Construct the URI of the search request
111111
var uriQuery = uriBase + "?q=" + Uri.EscapeDataString(searchQuery) +
112-
"&appid=" + accessKey + "&traffictype=Internal_monitor&market=en-us";
112+
"&appid=" + accessKey + "&market=en-us";
113113
114114
// Perform the Web request and get the response
115115
WebRequest request = HttpWebRequest.Create(uriQuery);

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-java-quickstart.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ The following code creates a `WebRequest`, sets the access key header, and adds
3232

3333
````
3434
// construct URL of search request (endpoint + query string)
35-
URL url = new URL(host + path + "?q=" + URLEncoder.encode(searchQuery, "UTF-8") + "appid=AEA845921DC03F506DC317A90EDDBF33074523F7&traffictype=Internal_monitor&market=en-us");
35+
URL url = new URL(host + path + "?q=" + URLEncoder.encode(searchQuery, "UTF-8") + "appid=AEA845921DC03F506DC317A90EDDBF33074523F7&market=en-us");
3636
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
3737
//connection.setRequestProperty("Ocp-Apim-Subscription-Key", subscriptionKey);
3838
@@ -89,14 +89,14 @@ public class LocalSearchCls {
8989
static String subscriptionKey = "YOUR-ACCESS-KEY";
9090
9191
static String host = "https://api.cognitive.microsoft.com/bing";
92-
static String path = "/v7.0/localbusinesses/search";
92+
static String path = "/v7.0/search";
9393
9494
static String searchTerm = "Hotel in Bellevue";
9595
9696
public static SearchResults SearchLocal (String searchQuery) throws Exception {
9797
// construct URL of search request (endpoint + query string)
9898
URL url = new URL(host + path + "?q=" + URLEncoder.encode(searchQuery, "UTF-8") +
99-
"&appid=" + subscriptionKey + "&traffictype=Internal_monitor&market=en-us");
99+
"&appid=" + subscriptionKey + "&market=en-us");
100100
HttpsURLConnection connection = (HttpsURLConnection)url.openConnection();
101101
//connection.setRequestProperty("Ocp-Apim-Subscription-Key", subscriptionKey);
102102

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-node-quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,12 @@ let https = require('https');
4747
let subscriptionKey = 'your-access-key';
4848
4949
let host = 'api.cognitive.microsoft.com/bing';
50-
let path = '/v7.0/localbusinesses/search';
50+
let path = '/v7.0/search';
5151
5252
let mkt = 'en-US';
5353
let q = 'hotel in Bellevue';
5454
55-
let params = '?q=' + encodeURI(q) + "&appid=" + accessKey + "&traffictype=Internal_monitor&mkt=" + mkt;
55+
let params = '?q=' + encodeURI(q) + "&appid=" + accessKey + "&mkt=" + mkt;
5656
5757
let response_handler = function (response) {
5858
let body = '';

articles/cognitive-services/bing-local-business-search/quickstarts/local-search-python-quickstart.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ import json
4343
subscriptionKey = 'YOUR-SUBSCRIPTION-KEY'
4444
4545
host = 'api.cognitive.microsoft.com/bing'
46-
path = '/v7.0/localbusinesses/search'
46+
path = '/v7.0/search'
4747
4848
query = 'restaurant in Bellevue'
4949
50-
params = '?q=' + urllib.parse.quote (query) + '&appid=' + subscriptionKey + '&traffictype=Internal_monitor&mkt=en-us'
50+
params = '?q=' + urllib.parse.quote (query) + '&appid=' + subscriptionKey + '&mkt=en-us'
5151
5252
def get_local():
5353
headers = {'Ocp-Apim-Subscription-Key': subscriptionKey}

0 commit comments

Comments
 (0)