Search code examples
azureazure-maps

Azure Maps Static Image service API issue, "invalid format" from the Data Upload API


I try to render data on a static Azure Map. I followed this tutorial

I can successfully upload the Geo.json to the static map API and do a request to check the upload status. However in the documentation is stated that I should receive a response like this:

{"udid" : "{udId}"}

The actual response I get is:

{"operationId": "{udId}"}

The next step is to call the static map API to request the plotted image, however I cannot complete this step since the API is giving a 400 error bad request. I have tried with "udid-" and "operationId-" but both give the same error. The call looks like:

https://atlas.microsoft.com/map/static/png?subscription-key={key=hidden}version=1.0&layer=basic&style=main&zoom=12&center=5.356764766897979,53.05137698634611&path=lc0000FF|fc0000FF|lw3|la0.80|fa0.30||operationId-{udId=hidden}

It looks like the documentation is not up-to-date or I did something wrong.


Solution

  • Looks like that tutorial is missing a step. After step 5 you have to grab the "Resource-Location" URL that's in the header of the operation response which points to the operation metadata. That will have the UID value in it. It will look something like this: https://us.atlas.microsoft.com/mapData/metadata/e0020b05-1f9b-5a8f-260f-87b7ef461432?api-version=2.0

    Append your &subscription-key={your key} to that URL, and you will see the UID.

    Alternatively, that GUID in the metadata URL is actually the UID, so you could parse it out instead of calling that service.