DigiOffice Gateway Web Services

<back to all web services

GetUserTranslations

Requires Authentication
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


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUserTranslations(GetTranslations):
    pass

Python GetUserTranslations DTOs

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

HTTP + CSV

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

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

{"TranslateKeys":["String"]}
HTTP/1.1 200 OK
Content-Type: text/csv
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"}