RWS Logo
Show / Hide Table of Contents

Dictionaries

List dictionaries

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries?sourceLanguageId=eng&targetLanguageId=fra" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

{
    "dictionaries": [
        {
            "dictionaryId": "dict1",
            "sourceLanguageId": "eng",
            "targetLanguageId": "fra"
        },
        {
            "dictionaryId": "dict2",
            "sourceLanguageId": "eng",
            "targetLanguageId": "fra"
        }
    ],
    "page": 1,
    "perPage": 25,
    "totalPages": 1,
    "totalItems": 2
}

Return a list of dictionaries.

HTTP Request

GET /api/v2/dictionaries

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
sourceLanguageId (optional) string Source language (3-letter code), required if target language is specified
targetLanguageId (optional) string Target language (3-letter code), required if source language is specified
page (optional) int Page number to return 1
perPage (optional) int Number of dictionaries to return per page 25

Returns

Returns a list of dictionaries as a DictionaryList object with the following attributes:

Name Type Description
dictionaries array of objects List of dictionaries as an array of Dictionary objects
page int Page number returned
perPage int Number of dictionaries returned per page
totalPages int Total number of pages available
totalItems int Total number of dictionaries

Create a dictionary

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries" \
	-X POST \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d dictionaryId="dict1" \
	-d sourceLanguageId="eng" \
	-d targetLanguageId="fra" \
	--data-urlencode content="PGRpY3Rpb25hcnk+PGRpY3QtZW50cmllcz48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+Ym9va21hcms8L3NyYy1zZWdtZW50Pjx0Z3Qtc2VnbWVudD5ib29rbWFyazwvdGd0LXNlZ21lbnQ+PHVzZXItY29tbWVudHM+PC91c2VyLWNvbW1lbnRzPjwvZGljdC1lbnRyeT48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+c29mdHdhcmU8L3NyYy1zZWdtZW50Pjx0Z3Qtc2VnbWVudD5zb2Z0d2FyZTwvdGd0LXNlZ21lbnQ+PHVzZXItY29tbWVudHM+PC91c2VyLWNvbW1lbnRzPjwvZGljdC1lbnRyeT48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+YnJvd3Nlcjwvc3JjLXNlZ21lbnQ+PHRndC1zZWdtZW50Pm5hdmlnYXRldXI8L3RndC1zZWdtZW50Pjx1c2VyLWNvbW1lbnRzPjwvdXNlci1jb21tZW50cz48L2RpY3QtZW50cnk+PC9kaWN0LWVudHJpZXM+PC9kaWN0aW9uYXJ5Pg=="

Example Response:

{
    "dictionaryId": "dict1",
    "sourceLanguageId": "eng",
    "targetLanguageId": "fra"
}

Create a dictionary to be available for use in translation.

HTTP Request

POST /api/v2/dictionaries

Request Parameters

Name Type Description Default Value
dictionaryId string Identifier of dictionary:
  • Must not contain any of the following characters: / " , % +
  • Must not only be . or \
  • Must be unique across all language pairs
sourceLanguageId string Source language (3-letter code)
targetLanguageId string Target language (3-letter code)
content (optional) string Base64-encoded and URL-encoded content of the dictionary in XML format (an example before base64-encoding can be found in the example response of Download a dictionary)

Returns

Returns the newly-created dictionary as a Dictionary object.

Update a dictionary

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1" \
	-X PUT \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	--data-urlencode content="PGRpY3Rpb25hcnk+PGRpY3QtZW50cmllcz48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+Ym9va21hcms8L3NyYy1zZWdtZW50Pjx0Z3Qtc2VnbWVudD5ib29rbWFyazwvdGd0LXNlZ21lbnQ+PHVzZXItY29tbWVudHM+PC91c2VyLWNvbW1lbnRzPjwvZGljdC1lbnRyeT48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+YnJvd3Nlcjwvc3JjLXNlZ21lbnQ+PHRndC1zZWdtZW50Pm5hdmlnYXRldXI8L3RndC1zZWdtZW50Pjx1c2VyLWNvbW1lbnRzPjwvdXNlci1jb21tZW50cz48L2RpY3QtZW50cnk+PC9kaWN0LWVudHJpZXM+PC9kaWN0aW9uYXJ5Pgo="

Example Response:

{
    "dictionaryId": "dict1",
    "sourceLanguageId": "eng",
    "targetLanguageId": "fra"
}

Update an existing dictionary.

HTTP Request

PUT /api/v2/dictionaries/{dictionaryId}

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

Name Type Description Default Value
content string Base64-encoded and URL-encoded content of the dictionary in XML format (an example before base64-encoding can be found in the example response of Download a dictionary)

Returns

Returns the updated dictionary Dictionary object.

Retrieve a dictionary

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1?includeContent=true" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

{
    "dictionaryId": "dict1",
    "sourceLanguageId": "eng",
    "targetLanguageId": "fra",
    "content": "PGRpY3Rpb25hcnk+PGRpY3QtZW50cmllcz48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+Ym9va21hcms8L3NyYy1zZWdtZW50Pjx0Z3Qtc2VnbWVudD5ib29rbWFyazwvdGd0LXNlZ21lbnQ+PHVzZXItY29tbWVudHM+PC91c2VyLWNvbW1lbnRzPjwvZGljdC1lbnRyeT48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+c29mdHdhcmU8L3NyYy1zZWdtZW50Pjx0Z3Qtc2VnbWVudD5zb2Z0d2FyZTwvdGd0LXNlZ21lbnQ+PHVzZXItY29tbWVudHM+PC91c2VyLWNvbW1lbnRzPjwvZGljdC1lbnRyeT48ZGljdC1lbnRyeT48c3JjLXNlZ21lbnQ+YnJvd3Nlcjwvc3JjLXNlZ21lbnQ+PHRndC1zZWdtZW50Pm5hdmlnYXRldXI8L3RndC1zZWdtZW50Pjx1c2VyLWNvbW1lbnRzPjwvdXNlci1jb21tZW50cz48L2RpY3QtZW50cnk+PC9kaWN0LWVudHJpZXM+PC9kaWN0aW9uYXJ5Pg=="
}

Return the description, and optionally the contents, of a dictionary.

HTTP Request

GET /api/v2/dictionaries/{dictionaryId}

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
includeContent (optional) boolean Include the base64-encoded contents of the dictionary false

Returns

Returns the specified dictionary as a Dictionary object with the following attributes:

Name Type Description
dictionaryId string Identifier of dictionary
sourceLanguageId string Source language (3-letter code)
targetLanguageId string Target language (3-letter code)
content string Base64-encoded content of the dictionary in XML format; only included when retrieving a dictionary with includeContent set to true

Download a dictionary

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1/download?exportFormat=text%2Fxml" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

<dictionary>
    <dict-entries>
        <dict-entry>
            <src-segment>bookmark</src-segment>
            <tgt-segment>bookmark</tgt-segment>
            <user-comments></user-comments>
        </dict-entry>
        <dict-entry>
            <src-segment>software</src-segment>
            <tgt-segment>software</tgt-segment>
            <user-comments></user-comments>
        </dict-entry>
        <dict-entry>
            <src-segment>browser</src-segment>
            <tgt-segment>navigateur</tgt-segment>
            <user-comments></user-comments>
        </dict-entry>
    </dict-entries>
</dictionary>

Download a dictionary as an XML or spreadhsheet file.

HTTP Request

GET /api/v2/dictionaries/{dictionaryId}/download

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
exportFormat (optional) string File format for downloaded dictionary (supports text/xml or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) text/xml

Returns

Returns the XML contents of a dictionary with MIME type text/xml.

Download dictionaries in a zip file

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/download-archive?dictionaryIds=dict1" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

application/zip

Download dictionaries as XML or spreadsheet files and archive in a zip.

HTTP Request

GET /api/v2/dictionaries/download-archive

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
dictionaryIds (optional) string Comma separated identifier of dictionaries
  • Total output size of dictionaries limited to 1GB
sourceLanguageId (optional) string Download only dictionaries with the given sourceLanguageId (3-letter code).
targetLanguageId (optional) string Download only dictionaries with the given targetLanguageId (3-letter code).
exportFormat (optional) string File format for downloaded dictionaries in the zip file (supports text/xml or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet) text/xml

Returns

Returns the contents of the dictionaries with the specified MIME type (text/xml or application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.

Delete a dictionary

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1" \
	-X DELETE \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

{
    "dictionaryId": "dict1",
    "sourceLanguageId": "eng",
    "targetLanguageId": "fra"
}

Remove a dictionary so it can no longer be used in translation.

HTTP Request

DELETE /api/v2/dictionaries/{dictionaryId}

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Returns

Returns the deleted dictionary as a Dictionary object.

Delete dictionaries

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/batch-delete" \
	-X DELETE \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d dictionaryIds="dict1"

Example Response:

1

Remove dictionaries so they can no longer be used in translation.

HTTP Request

DELETE /api/v2/dictionaries/batch-delete

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
dictionaryIds (optional) string Comma separated identifier of dictionaries
sourceLanguageId (optional) string Delete only dictionaries with the given sourceLanguageId (3-letter code).
targetLanguageId (optional) string Delete only dictionaries with the given targetLanguageId (3-letter code).

Returns

Returns the number of deleted dictionaries.

List dictionary terms

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1/term?comment=greeting&source=hello&target=bonjour" \
	-X GET \
	-u u_jsmith@example.com_u0VmztKJrwqf:

Example Response:

{
    "dictionaryId": "dict1",
    "terms": [
        {
            "source": "hello",
            "target": "bonjour",
            "comment": "greeting"
        },
        {
            "source": "bye",
            "target": "au revoir",
            "comment": "farewell"
        }
    ],
    "termFilter": {
        "source": "",
        "target": "",
        "comment": ""
    },
    "page": 1,
    "perPage": 25,
    "totalPages": 1,
    "totalTerms": 2
}

List the terms from an existing dictionary.

HTTP Request

GET /api/v2/dictionaries/{dictionaryId}/term

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

These parameters should be added to the URL as a query string.
Name Type Description Default Value
source (optional) string Filter list by given source text
target (optional) string Filter list by given target text
comment (optional) string Filter list by given comment text

Returns

Returns the list of dictionary terms as a TermList object.

Create a dictionary term

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1/term" \
	-X POST \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d comment="greeting" \
	-d source="hello" \
	-d target="bonjour"

Example Response:

{
    "source": "hello",
    "target": "bonjour",
    "comment": "greeting"
}

Create a term within an existing dictionary to be available for use in translation.

HTTP Request

POST /api/v2/dictionaries/{dictionaryId}/term

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

Name Type Description Default Value
source string Source text of term
target string Target text of term
comment (optional) string Comment text of term

Returns

Returns the newly-created dictionary term as a Term object.

Update a dictionary term

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1/term" \
	-X PUT \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d comment="greeting" \
	-d originalSource="hello" \
	-d source="hello" \
	-d target="salut"

Example Response:

{
    "source": "hello",
    "target": "salut",
    "comment": "greeting"
}

Update a term within an existing dictionary.

HTTP Request

PUT /api/v2/dictionaries/{dictionaryId}/term

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

Name Type Description Default Value
originalSource string Source text of existing term to be updated
source string Updated source text of term
target string Updated target text of term
comment (optional) string Updated comment text of term

Returns

Returns the updated dictionary term as a Term object.

Delete a dictionary term

Example Request:

curl "https://controller-host:8001/api/v2/dictionaries/dict1/term/delete" \
	-X PUT \
	-u u_jsmith@example.com_u0VmztKJrwqf: \
	-d source="hello"

Example Response:

{
    "source": "hello"
}

Remove a term within a dictionary so it can no longer be used in translation.

HTTP Request

PUT /api/v2/dictionaries/{dictionaryId}/term/delete

Path Parameters

Name Type Description
dictionaryId string Identifier of dictionary

Request Parameters

Name Type Description Default Value
source string Source text of term to delete. This parameter can be repeated to delete multiple terms.

Returns

Returns the deleted dictionary as a DeletedTerm object array

In this page
Back to top