DigiOffice Gateway Web Services

<back to all web services

GetTranslations

import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Translation(ITranslation):
    key: Optional[str] = None
    nl: Optional[str] = None
    en: Optional[str] = None
    de: Optional[str] = None
    fr: Optional[str] = None
    c1: Optional[str] = None
    c2: Optional[str] = None
    c3: Optional[str] = None
    c4: Optional[str] = None
    c5: Optional[str] = None
    c6: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetTranslationsResponse:
    translations: Optional[List[Translation]] = None
    preferred_language: Optional[str] = None
    preferred_language_short: Optional[str] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetTranslations:
    translate_keys: Optional[List[str]] = None

Python GetTranslations DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /jsv/reply/GetTranslations HTTP/1.1 
Host: digiofficeapigateway.deltares.nl 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	TranslateKeys: 
	[
		String
	]
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Translations: 
	[
		{
			Key: String,
			NL: String,
			EN: String,
			DE: String,
			FR: String,
			C1: String,
			C2: String,
			C3: String,
			C4: String,
			C5: String,
			C6: String
		}
	],
	PreferredLanguage: String,
	PreferredLanguageShort: String
}