Skip Navigation
Expand
Accept-Language header must match the interface language in Connect REST API
Answer ID 10151   |   Last Review Date 01/27/2021

Why does the Connect REST API return an error stating that the language does not match the interface?

Issue:

A customization or integration is sending a request to the Connect REST API and receives an error message such as the following:

This interface uses da-DK language which does not match with requested language of 'en-US,en;q=0.9'

Environment:

Connect REST API, All supported versions

Resolution:

In the request, either include the locale of the interface in the Accept-Language header, or do not include that header at all.

Notes:

If the client is sending the Accept-Language header in a request to the Connect REST API, the language of the interface must match of the options listed in the header. How this header is set is dependent on the client that is making the request. Calls made natively from a web browser, such as when loading an endpoint directly, would use the configured language(s) of the browser.

In the example above, the request has this header:

Accept-Language: en-US,en;q=0.9

This client application prefers English (US), but would accept other English locales (such as en-GB or en-AU). In respecting this Accept-Language header, the API does not send the normal response and instead sends the error message in the requested language.

Refer to the documentation for the client application you are using for how to set this header. External resources are freely available for full technical information on Accept-Language, as well as all headers included in the HTTP specification. Since that latter information can easily be found by any search engine with the name of the header as the query, we do not maintain any direct links here.