Akpos
Akpos

Reputation: 13

Authentication issues when using Bing Maps REST API on Power BI

I keep having this error when using Bing Maps API, as anyone encountered this issue?

enter image description here

Upvotes: 0

Views: 841

Answers (2)

Akpos
Akpos

Reputation: 13

I resolved the issue. I kept getting the authentication issues because there was a "#" in the address line. If an apt or street number is written as #.., it will keep asking for credentials. Just change the # to No and it works fine.

Upvotes: 1

Dreekun
Dreekun

Reputation: 442

I have. What have you done exactly? Why is it complaining about credentials?

Here is an example function I used at the time. It fetches the Coordinates for a desired city. You can paste it in Advanced Editor and make a function. Just make sure to insert your api key.

let
  fxGetCoords = (city as text) =>
    let
        Source = Json.Document(
                  Web.Contents("http://dev.virtualearth.net/REST/v1/Locations?query=" & 
                  city & "&includeNeighborhood=0&key="xxxxxx-insert-your-key-here- 
                  xxxxxxxx")
                  ),
        resourceSets = Source[resourceSets],
        resourceSets1 = resourceSets{0},
        resources = resourceSets1[resources],
        resources1 = resources{0},
        point = resources1[point],
        coordinates = point[coordinates],
        #"Converted to Table" = Table.FromList(coordinates, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
        #"Transposed Table" = Table.Transpose(#"Converted to Table"),
        #"Renamed Columns" = Table.RenameColumns(#"Transposed Table",{{"Column1", "Latitude"}, {"Column2", "Longitude"}}),
        #"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Latitude", type number}, {"Longitude", type number}})
    in
        #"Changed Type"


in fxGetCoords

If this works the problem is not your credentials, but how you are using them.

Upvotes: 0

Related Questions