DigiOffice Gateway Web Services

<back to all web services

GetTranslations

import Foundation
import ServiceStack

public class GetTranslations : Codable
{
    public var translateKeys:[String] = []

    required public init(){}
}

// @DataContract
public class GetTranslationsResponse : Codable
{
    // @DataMember
    public var translations:[Translation] = []

    // @DataMember
    public var preferredLanguage:String?

    // @DataMember
    public var preferredLanguageShort:String?

    required public init(){}
}

// @DataContract
public class Translation : ITranslation, Codable
{
    // @DataMember
    public var key:String?

    // @DataMember
    public var nl:String?

    // @DataMember
    public var en:String?

    // @DataMember
    public var de:String?

    // @DataMember
    public var fr:String?

    // @DataMember
    public var c1:String?

    // @DataMember
    public var c2:String?

    // @DataMember
    public var c3:String?

    // @DataMember
    public var c4:String?

    // @DataMember
    public var c5:String?

    // @DataMember
    public var c6:String?

    required public init(){}
}


Swift GetTranslations 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/GetTranslations 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"}