Show / Hide Table of Contents

Dictionary Management

The purpose of this set of API calls is to enable dictionary management from the API perspective. They will allow users to create a dictionary, add terms to an existing dictionary and manage dictionaries.

Create dictionary

This call creates a new dictionary within a specific account

Linux

curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut"
}' 'https://api.languageweaver.com/v4/accounts/12/dictionaries'
Windows

curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
  \"name\": \"dictionary\",^
  \"description\": \"first dictionary\",^
  \"lastName\": \"Smith\",^
  \"source\": \"eng\",^
  \"target\": \"dut\"^
}" https://api.languageweaver.com/v4/accounts/12/dictionaries

Access token type
User credentials - Allowed User Roles: Admin, Linguist

HTTP Request
POST /v4/accounts/{accountId}/dictionaries

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Request Parameters

Request JSON:

{
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut"
}

Format
JSON

Name Type Mandatory Default value Description
name string yes String specifying the name of the dictionary. Must be unique within the account.
description string no Empty string String specifying a description for the dictionary
source string yes Three letters language code of the source language for the dictionary
target string yes Three letters language code of the target language for the dictionary

Response JSON:

{
   "dictionaryId": "e8b01170-1bc4-4d61-89f7-fc2f65733442",
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut"
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
dictionaryId string Unique string identifier for the dictionary
accountId integer Unique numeric identifier for the account associated to the dictionary
name string Name of the dictionary
description string Description for the dictionary
source string Three letters language code of the source language for the dictionary
target string Three letters language code of the target language for the dictionary

Error JSON:

{
   "errors":[
      {
         "code":1025,
         "description":"dictionary with name: ... already exists"
      }
   ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When the dictionary is successfully created
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error

Get dictionary

This call should be used to retrieve information about the dictionary. The dictionary id must be provided.

Linux

curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442'
Windows

curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442

Access token type
User credentials - Allowed User Roles: Admin, Linguist, Translator

HTTP Request
GET /v4/accounts/{accountId}/dictionaries/{dictionaryId}

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Response JSON:

{
   "dictionaryId": "e8b01170-1bc4-4d61-89f7-fc2f65733442",
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut",
   "accountId": 12
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
dictionaryId string Unique string identifier for the dictionary
accountId integer Unique numeric identifier for the account associated to the dictionary
name string Name of the dictionary
description string Description for the dictionary
source string Three letters language code of the source language for the dictionary
target string Three letters language code of the target language for the dictionary

Error JSON:

{
   "errors":[
      {
         "code":1002,
         "description":"account with id 12 does not exist"
      }
   ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When the dictionary is returned
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error

Update dictionary

This call is used to update an existing dictionary. You need to provide the dictionary id. All dictionary information needs to be provided. Partial updates are not allowed.

Linux

curl -XPUT -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
   "dictionaryId": "e8b01170-1bc4-4d61-89f7-fc2f65733442",
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut"
}' 'https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442'
Windows

curl -XPUT -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
 \"name\": \"dictionary\",^
 \"description\": \"first dictionary\",^
 \"source\": \"eng\",^
 \"target\": \"dut\"^
}" https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442

Access token type
User credentials - Allowed User Roles: Admin, Linguist

HTTP Request
PUT /v4/accounts/{accountId}/dictionaries/{dictionaryId}

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Request Parameters

Request JSON:

{
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut"
}

Format
JSON

Name Type Description
name string Name of the dictionary
description string Description for the dictionary
source string Three letters language code of the source language for the dictionary
target string Three letters language code of the target language for the dictionary

Response JSON:

{
   "dictionaryId": "e8b01170-1bc4-4d61-89f7-fc2f65733442",
   "name": "dictionary",
   "description": "first dictionary",
   "source": "eng",
   "target": "dut",
   "accountId": 12
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
dictionaryId string Unique string identifier for the dictionary
accountId integer Unique numeric identifier for the account associated to the dictionary
name string Name of the dictionary
description string Description for the dictionary
source string Three letters language code of the source language for the dictionary
target string Three letters language code of the target language for the dictionary

Error JSON:

{
   "errors":[
      {
         "code":1002,
         "description":"account with id 12 does not exist"
      }
   ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When the dictionary is successfully updated
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error

Delete dictionary

This call is used to delete an existing dictionary. The dictionary id needs to be provided.

Linux

curl -XDELETE -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" \
'https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442'
Windows

curl -XDELETE -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" ^
https://api.languageweaver.com/v4/accounts/12/dictionaries/e8b01170-1bc4-4d61-89f7-fc2f65733442

Access token type
User credentials - Allowed User Roles: Admin

HTTP Request
DELETE /v4/accounts/{accountId}/dictionaries/{dictionaryId}

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

When the dictionary is deleted successfully, no content is returned.

Error JSON:

{
   "errors":[
      {
         "code":1002,
         "description":"account with id 12 does not exist"
      }
   ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
204 When the dictionary is deleted
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error

Get all dictionaries for the account

This call should be used to retrieve information about all the dictionaries of the specified account.
The account id for which the info is wanted must be provided as path parameter.
In addition, a page number and a page size parameter should be provided. Both parameters are optional.

Linux

curl -XGET -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' \
'https://api.languageweaver.com/v4/accounts/12/dictionaries?pageNumber=1&pageSize=10'
Windows

curl -XGET -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" ^
https://api.languageweaver.com/v4/accounts/12/dictionaries?pageNumber=1&pageSize=10

Access token type
User credentials - Allowed User Roles: Admin, Linguist, Translator
API credentials

HTTP Request
GET /v4/accounts/{accountId}/dictionaries?pageNumber={pageNumber}&pageSize={pageSize}

Headers

Name Value (example) Description
Authorization Bearer asd0eXAi... Bearer token
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 Optional unique request identifier (UUID) provided by client

Query Parameters

Name Type Mandatory Default value Description
pageNumber int no 1 Integer specifying the requested page number
pageSize int no 1000 Integer specifying the requested page size, limited to 1000

Response JSON:

{
   "totalCount": 2,
   "pageNumber": 1,
   "pageSize": 10,
   "accountId": 12,
   "dictionaries": [
     {
       "name": "dictionary1",
       "description": "first dictionary",
       "source": "eng",
       "target": "dut",
       "dictionaryId": "0a1f42b3-c048-4965-8e9f-6ddf7bc8adf2",
       "createdBy": "dictionary.creator@domain.com",
       "creationDate": "2019/12/03",
       "lastModifiedBy": "johnDoe@domain.com",
       "lastModifyDate": "2019/12/23"
     },
     {
       "name": "dictionary2",
       "description": "second dictionary",
       "source": "eng",
       "target": "fra",
       "dictionaryId": "0ad805ee-3b87-479d-914e-a326eaabe5e4",
       "createdBy": "johnDoe@domain.com",
       "creationDate": "2019/11/03",
       "lastModifiedBy": "johnDoe@domain.com",
       "lastModifyDate": "2020/01/07"
     }
   ]
}

Response

Headers

Name Value (example) Description
BeGlobal-Request-ID dbbbc062-88a7-4783-8d52-dea795e517f4 Unique request identifier (UUID)
Trace-ID 2c0c4dda-8333-4538-983e-e098de7cf555 The identifier provided in the request (UUID)

Format
JSON

Name Type Description
accountId integer Unique numeric identifier for the account associated to the dictionary
dictionaryId string Unique string identifier for the dictionary
name string Name of the dictionary
description string Description for the dictionary
source string Three letters language code of the source language for the dictionary
target string Three letters language code of the target language for the dictionary
createdBy string The email of the user who created the dictionary
creationDate string Date when the dictionary was created
lastModifiedBy string The email of the user who last modified the dictionary
lastModifyDate string Date when the dictionary was last modified
dictionaries list List of dictionaries
totalCount integer Total number of dictionaries for the given account
pageNumber integer Requested page number
pageSize integer Requested page size

Error JSON:

{
   "errors":[
      {
         "code":1002,
         "description":"account with id 12 does not exist"
      }
   ]
}

Error Response

Format
JSON

Name Type Description
errors list A list with the errors that occurred
code integer The code of the error
description string The description of the error

Returned HTTP Codes:

Http Code Description
200 When the dictionaries were returned
400 When the input data is not valid
401 When the authentication process failed or the access token is not valid
403 Forbidden to access resource
500 Application internal error





In This Page
Back to top