Translation admin API Resource

Abstract class for REST webservices

POST /api/admin/translation/import

Import selected translations for language specified in fileName from uploadFile - language is taken from fileName prefix getFirst, if it's not matched it's taken from hidden "Language" sheet in file

Request Parameters
name type description constraints
activities query boolean
activitymessages query boolean
dictionaries query if true, dictionaries translations are imported boolean
errorcodes query if true, errorCodes translations are imported boolean
fields query if true, fields translations are imported boolean
legendtexts query if true, legendTexts translations are imported boolean
objectclasses query if true, objectClasses translations are imported boolean
units query if true, units units are imported boolean
Request Body
media type data type description
multipart/form-data (custom) request with upload file and selected translations in queryString, if all translation flags are false, all translations are imported
Response Body
media type data type description
application/json object (JSON) JSON response with detailed import report

Example of response:

{"list":[{"errorMessage":"No Translations found for this type in import file","errorCodeNumber":10919,"errorCode":"NoTranslationsError","errorContext":"errorcodes Translations Import","errorLevel":"Critical"},{"errorMessage":"Successfully updated ReferenceValue Contract translation with Kontrakt2 for contract","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"objectclasses Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue inch translation with cal for 1","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue foot translation with stopa for 2","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue yard translation with jarddd for 3","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue mile translation with mila for 4","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue centimeter translation with centymetr for 6","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue meter translation with metr for 7","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"Successfully updated ReferenceValue kilometer translation with kilometr for 8","errorCodeNumber":10916,"errorCode":"TranslationUpdateSuccessful","errorContext":"units Translations Import","errorLevel":"Info"},{"errorMessage":"No Translations found for this type in import file","errorCodeNumber":10919,"errorCode":"NoTranslationsError","errorContext":"fields Translations Import","errorLevel":"Critical"},{"errorMessage":"No Translations found for this type in import file","errorCodeNumber":10919,"errorCode":"NoTranslationsError","errorContext":"dictionaries Translations Import","errorLevel":"Critical"}],"success":true}

Example

Request
POST /api/admin/translation/import
Content-Type: multipart/form-data
Accept: application/json

                

                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
...
                
              

GET /api/admin/translation/json/{labelType}

Request Parameters
name type description
labelType path
Response Body
media type data type description
application/json object (JSON)

Example

Request
GET /api/admin/translation/json/{labelType}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /api/admin/translation/export/xls/{langId}

Get xls file with selected translations for language. If all translation flags are false, all translations are exported

Request Parameters
name type description constraints
langId path Language Id int
activities query boolean
activitymessages query boolean
dictionaries query if true, dictionaries translations are exported boolean
errorcodes query if true, errorCodes translations are exported boolean
fields query if true, fields translations are exported boolean
legendtexts query if true, legendTexts translations are exported boolean
objectclasses query if true, objectClasses translations are exported boolean
units query if true, units units are exported boolean
Response Body
media type data type description
application/vnd.ms-excel object xls file with selected translations for given language

Example

Request
GET /api/admin/translation/export/xls/{langId}
Content-Type: */*
Accept: application/vnd.ms-excel

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/vnd.ms-excel

                
...
                
              

POST /api/admin/translation/export/xls/{langId}

Request Parameters
name type description
langId path
Response Body
media type data type description
application/json object (JSON)

Example

Request
POST /api/admin/translation/export/xls/{langId}
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
...
                
              

PUT /api/admin/translation/json/{labelType}/{langId}

Request Parameters
name type description constraints
labelType path  
langId path int
Request Body
media type data type
application/json HdcLabelTranslationsTO (JSON)
Response Body
media type data type description
application/json HdcLabelTranslationsTO (JSON)

Example

Request
PUT /api/admin/translation/json/{labelType}/{langId}
Content-Type: application/json
Accept: application/json

                
{ }
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }