Show / Hide Table of Contents

Deprecated Endpoints

These endpoints are deprecated and will be discontinued at the end of June 2020.

Synchronous Language Identification

Synchronous endpoints specific to language identification and multi language identification.

1. Language identification for text

Deprecated - please integrate the new asynchronous multi language detection api for text This call will allow the user to identify the source language of a given input. The source content has to be in format plain text UTF8.

Linux

curl -XPOST -H 'Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI' -H 'Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555' -H "Content-type: application/json" -d '{
"input": "A mountain is generally steeper than a hill"}' \
'https://api.languageweaver.com/v4/language-identification'
Windows

curl -XPOST -H "Authorization: Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" -H "Content-type: application/json" -d ^
"{^
 \"input\": \"A mountain is generally steeper than a hill\"^
}" https://api.languageweaver.com/v4/language-identification

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

HTTP Request
POST /v4/language-identification

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 JSON:

{
   "input": "A mountain is generally steeper than a hill"
}

Request Parameters

Format
JSON

Name Type Mandatory Default value Description
input string yes The source text for which we want to identify the language.

Response JSON:

{
   "language": "eng",
   "percent": 100
}

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
language string Three letters language code of the detected language
percent int The percentage of the language represented in the text
{
    "errors": [{
        "code": 41,
        "description": "Language detection failed"
    }]
}

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 language was successfully detected and 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

2. Language identification for file

Deprecated - please integrate the new asynchronous multi language detection api for file This call will allow the user to identify the source language of a given input. The source content has to be in format plain text UTF8.

Linux

curl -XPOST \
  -H "Content-Type:multipart/form-data" \
  -H "Authorization:Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" \
  -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" \
  -F "input=@\"./demo.txt\";filename=\"demo.txt\"" \
'https://api.languageweaver.com/v4/language-identification'
Windows

curl -XPOST^
 -H "Content-Type:multipart/form-data"^
 -H "Authorization:Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI"^
 -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555"^
 -F "input=@\"demo.txt\";filename=\"demo.txt\""^
 https://api.languageweaver.com/v4/language-identification

Request Body:

(Request Body)
------------8cb4ac0ce53d926Content-Disposition: form-data; fileName="demo.txt"
Content-Type: application/octet
(Binary file)
---------8cb4ac0ce53d926-

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

HTTP Request
POST /v4/language-identification

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

Format
multipart/form-data

Name Type Mandatory Default value Description
input file yes The binary content of the file

Response JSON:

{
   "language": "eng",
   "percent": 100
}

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
language string Three letters language code of the detected language
percent int The percentage of the language represented in the text
{
    "errors": [{
        "code": 41,
        "description": "Language detection failed"
    }]
}

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 language was successfully detected and 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

3. Multi Language identification for file

Deprecated - please integrate the new asynchronous multi language detection api for file This call will allow the user to identify the source language of a given file input.

Linux

curl -XPOST \
  -H "Content-Type:multipart/form-data" \
  -H "Authorization:Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI" \
  -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555" \
  -F "input=@\"./demo.txt\";filename=\"demo.txt\"" \
  -F "inputFormat=PLAIN" \
'https://api.languageweaver.com/v4/multi-language-identification'
Windows

curl -XPOST^
 -H "Content-Type:multipart/form-data"^
 -H "Authorization:Bearer asd0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsI"^
 -H "Trace-ID: 2c0c4dda-8333-4538-983e-e098de7cf555"^
 -F "input=@\"demo.txt\";filename=\"demo.txt\""^
 -F "inputFormat=PLAIN"^
 https://api.languageweaver.com/v4/multi-language-identification

Request Body:

(Request Body)
--8MsmExZ-SgFlDSniddeMZOkUV90emq
Content-Disposition: form-data; name="input"
Content-Type: application/octet-stream
Content-Length: 9

doc 1
--8MsmExZ-SgFlDSniddeMZOkUV90emq
Content-Disposition: form-data; name="inputFormat"
Content-Type: text/plain;charset=UTF-8
Content-Length: 10

text/plain
--8MsmExZ-SgFlDSniddeMZOkUV90emq--

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

HTTP Request
POST /v4/multi-language-identification

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

Format
multipart/form-data

Name Type Mandatory Default value Description
input file yes The binary content of the file
inputFormat string no PLAIN Format of input content. See Input Formats.

Response JSON:

{
  "encoding": "utf8",
  "languages": [
    {
      "code": "eng",
      "name": "English",
      "languageTag": "en",
      "score": 0.99
    }
  ],
  "scripts": [
    {
      "code": "Latn",
      "name": "Latin",
      "percent": 80.6
    },
    {
      "code": "Zyyy",
      "name": "Common",
      "percent": 19.4
    }
  ]
}

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
encoding string Source content encoding
languages array Array of detected languages, sorted in descending order of their score
code string Detected language code. See Languages Table.
languageTag string Detected language tag
name string Detected language full name. See Languages Table.
score float A value between 0 and 1; the closer the value is to 1, the greater the association between the detected language and source content
scripts array Array of scripts that constitute the input text, sorted in descending order of the percentage of characters using that script.
code string ISO-15924 code of detected script. See Script Codes.
name string Name of detected script
percent float Percentage of source content using specific script
{
    "errors": [{
        "code": 41,
        "description": "Language detection failed"
    }]
}

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 languages are successfully detected
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



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.

1. Get all dictionaries for the account

Deprecated - please integrate the new paginated 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.

Linux

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

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

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

HTTP Request
GET /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

Response JSON:

{
   "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

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
  • Synchronous Language Identification
    • 1. Language identification for text
    • 2. Language identification for file
    • 3. Multi Language identification for file
  • Dictionary Management
    • 1. Get all dictionaries for the account
Back to top