locked
Azure Map Search API | Language Parameter is ignored RRS feed

  • Question

  • Hello Azure Team,

    i was just implementing the Azure Map Search API into our Backend when i noticed that setting the language query parameter didn't have any effect. I checked your documentation site if i did something wrong, then i noticed that the error even appears on your demo page.

    docs.microsoft.com/en-us/rest/api/maps/search/getsearchaddress#code-try-0

    I filled out the subscription-key and added a language parameter with the value "en-GB" or "en-US" and ran the request.

    The result i got was: 

    { "summary": { "query": "new york city", "queryType": "NON_NEAR", "queryTime": 95, "numResults": 10, "offset": 0, "totalResults": 224, "fuzzyLevel": 1 }, "results": [ { "type": "Geography", "id": "US/GEO/p0/2602", "score": 8.475540161132812, "entityType": "Municipality", "address": { "municipality": "New York", "countrySubdivision": "NY", "countrySubdivisionName": "New York", "countryCode": "US", "country": "Vereinigte Staaten", "countryCodeISO3": "USA", "freeformAddress": "New York, NY" },

    ...

    When the result was actually german, i knew that my language parameter was being ignored.
    Using the Accept-Language Parameter instead worked, when i set the Accept-Language parameter to "en-US" the result was english, but there is also a second bug with Accept-Language.

    Accept-Language should actually support "*", "en" or "de" as key, but using any of these keys or even just two letter names, will result in a 400 Bad Request.

    So as summary:
    - The Query Language Parameter doesn't work and instead the API is using the Header Accept-Language Parameter
    - Two letter language names aren't supported terms in "Accept-Language" and will result in a 400 Bad Request.
    - The Any Language Wildcard "*" is not supported.

    What i actually wanted to do was using the "Any Language" Wildcard and use the language query parameter for user requests, but at this moment, this will not work.

    I hope i was able to explain the situation and will be happy to get an answer from you :)

    Thanks.

    Best Regards

    Saif-Dean Ben Mansour

    Tuesday, May 26, 2020 8:26 AM

Answers