Elevation Api Not working

Anonymous
2024-04-04T16:23:30.31+00:00

I have longtitude and latitude and I am trying to get Elevation but I am getting the below error

http://dev.virtualearth.net/REST/v1/Elevation/List?points={17.75,83.34,17.75,83.34,17.75,83.34}&heights={heights}&key={BingKey}

{"authenticationResultCode":"InvalidCredentials","brandLogoUri":"http://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":"fa76271ff37f3fd8eb2d62f8d006cc2a"}
Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
736 questions
Azure Startups
Azure Startups
Azure: A cloud computing platform and infrastructure for building, deploying and managing applications and services through a worldwide network of Microsoft-managed datacenters.Startups: Companies that are in their initial stages of business and typically developing a business model and seeking financing.
378 questions
0 comments No comments
{count} votes

Accepted answer
  1. rbrundritt 18,671 Reputation points Microsoft Employee
    2024-04-04T17:03:27.8833333+00:00

    The error is indicating that there is an issue with the Bing Maps key you provided in the request. Double check that you added your key correctly, many accidentally clip off the last character or two.

    Also, your request looks odd, there should be no curly braces around any of the parameters (points, heights, key). If those are there in your request, it's possible that is causing an issue for the request being parsed and thus the key is not being properly parsed.

    Additionally you are not providing any value for the heights parameter, so that should be removed. Here is what your query URL should look like, just append your key to the end (I switched this touse https as that is a best practice):

    https://dev.virtualearth.net/REST/v1/Elevation/List?points=17.75,83.34,17.75,83.34,17.75,83.34&key=

    If the above doesn't work and key is 100% correct, try creating a new key and see if that works. Small chance there was some issue when the current key was created that might be causing an issue.

    Side note, all of your points in the query are the same, so you are going to get the same result 3 times. If you are processing a lot of points across multiple requests, avoiding duplicates can help reduce the total number of requests you make, thus less transactions/costs, while reducing the processing time.


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.