-1

I'm using Bing Map API to get latitude and longitude from address

https://dev.virtualearth.net/REST/v1/Locations?q=100+Somerset+St+New+Brunswick+NJ+08901&key={BingKey}

Got "authenticationResultCode":"ValidCredentials" latitude and longitude as 40.486216,-74.451819. But, when I use the same Bing MAP API key to get my Location detail from the lat and long, I get

https://dev.virtualearth.net/REST/v1/locationrecog/40.486216,-74.451819?key={BingKey}&output=json

Getting InvalidCredentials

{"authenticationResultCode":"InvalidCredentials","brandLogoUri":"https:\/\/dev.virtualearth.net\/Branding\/logo_powered_by.png","copyright":"Copyright © 2024 Microsoft and its suppliers. All rights reserved. This API cannot be accessed and the content and any results may not be used, reproduced or transmitted in any manner without express written permission from Microsoft Corporation.","errorDetails":["Access was denied. You may have entered your credentials incorrectly, or you might not have access to the requested resource or operation."],"resourceSets":[],"statusCode":401,"statusDescription":"Unauthorized","traceId":"74c389b15e4e447ba1baf0089141d813|BN00006C5D|0.0.0.1"}

What wrong am I doing here. Any help please.

2
  • Double-check your BingKey value; run both URLs through a parser and make sure the key query string value is the same for both. Otherwise contact support Commented Jan 15, 2024 at 4:57
  • typo error in my key. Thank you! Commented Jan 17, 2024 at 19:20

1 Answer 1

-1

I tried the query you provided and it worked fine with my key. Double check the key in your URL, very easy to forget a character when copy/pasting (that's got me many times over the years).

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.