Localization
Lookup a localized server string from it's lookup key and translate based on Accept-Language header or "culture" URL parameter.
GET /v1/language
Sample
json
GET /v1/language
{
"key": "Key"
}Auth: Access token (Bearer).
Parameters
| Name | In | Required | Description |
|---|---|---|---|
key | query | No | The lookup key for the string. |
Responses
| Status | Description |
|---|---|
200 | Successfully retrieved a localized string from the lookup key provided. |
400 | The request failed validation, the error object will contain further information. |
422 | The request payload is invalid, the error object will contain further information. |
429 | Too many requests are being sent concurrently or rate limiting has taken effect. |
500 | An unexpected error occurred, the error object will contain further information. |
Response body
| Field | Type | Required | Description |
|---|---|---|---|
success | boolean | No | Gets a value indicating whether the operation was successful. |
result | string? | No | Gets the response payload. |
json
{
"success": true,
"result": "string"
}Code samples
ts
// @vantagepay/vantagepay
// Retrieves localized UI language strings. For lookup languages use client.lookups.getLanguages().
// Not wrapped by the JavaScript SDK - call the endpoint directly with the active token.
const response = await fetch(baseUrl + '/v1/language', {
method: 'GET',
headers: { Authorization: 'Bearer ' + ApiTokens.accessToken },
})
const result = await response.json()csharp
// VantagePay.SDK
// Retrieves localized UI language strings. For lookup languages use client.Lookups.GetLanguagesAsync().
// Not wrapped by the .NET SDK - call the endpoint directly with an authorized HttpClient.
using var http = new HttpClient { BaseAddress = new Uri("https://sandbox-api.vantagepay.dev") };
http.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", client.ApiTokens.AccessToken);
var response = await http.GetAsync("/v1/language");
response.EnsureSuccessStatusCode();