Introduction
OverIT APIs offer the possibility to differentiate the language of results based on consumers needs.
To request the use of a specific language, the client needs to specify the _language parameter and select the desired language. Please note that this only affects some fields in the response, it does not change the format of the response nor the content which is not written in natural language.
Language
Request QueryParameters
The parameter _language allows the client to specify the desired language by using one of several options:
-
ALL: Request the server to return every possible translation of the response data.
-
USER: Request the server to return the response data translated into the current user language (if available).
-
IANA 2-char language subtag: Request the server to return the response translated into a specific language, identified by 2 characters as specified by IANA Language Subtag Registry.
Response payload
No additional field is returned after requesting a specific language. The requested translations will appear directly in the response payload data using a specific format, which is an array of string pairs. A single pair consists of two parameters: lang and value. The first contains the 2-char IANA Subtag which identified the language, the second contains the translated value.
"description": [
{
"lang": "string",
"value": "string"
}
]
Example
Request
curl "<https://api.overit.cloud/api/r1/work-order?_language=ALL>" \
-H "Authorization: Bearer <personal_access_token>"
Response
"content": {
"id": 0,
"code": "Order-001",
"description": [
{
"lang": "IT",
"value": "La mia descrizione in Italiano."
},
{
"lang": "EN",
"value": "My description in English."
}
],
}