API Reference
Request URL
Verb/Method | POST |
URL Elements | https://(hostname) |
Sample URL | https://revapi.reverieinc.com/ |
Header
Header Name | Description | |
---|---|---|
Content-Type | The format of the data to be posted. | application/JSON |
REV-API-KEY | A unique key/token provided by Reverie to identify the user using the Localization API. | - |
REV-APP-ID | The unique account ID to identify the user and the default account settings. | - |
REV-APPNAME | The parameter to identify the API. | localization |
REV-APPVERSION | The version refers to the specific iteration of the API that is being called. | Note- The default version is 2.0 |
src_lang | The language of the input text | Mention the ISO Language code of the input text. Refer Language Codes for valid language code. |
tgt_lang | Language to which you want to localize the input text Note- To enter multiple target languages, separate the value using the comma separator(,). For example: “tgt_lang” : “hi, ta” | Mention the ISO Language code of the target language. Refer to Language Codes for valid language code. |
domain | The Domain refers to the universe in which you use the Transliteration API. Example- Health Care, Insurance, Legal, etc. | Mention the domain ID. Refer to Supporting Domain in Localization API section for valid domain ID. Note - The default domain 1 |
Request
Element | Type | Is Mandatory? | Description |
---|---|---|---|
data | array of content | Yes | List of input text for localization. |
enableNmt | boolean | No | Specify whether the content localization process should use NMT technology or not. i.e., When the enableNmt value is true, the system will initially refer to the Lookup database to localize content. If the content is not available in the database, then the NMT is used for translation. Note - By default, the enableNmt= false |
enableTransliteration | boolean | No | Specify whether the content localization process should use transliteration technology or not. i.e., When the enableTransliteration value is true, the system will initially refer to the Lookup database to localize content. If the content is not available in the database, then nmt is used for translation. If nmt fails, transliteration is called. Note - By default, the enableTransliteration= true
|
enableLookup | boolean | No | The parameter will specify whether the application should refer to the Lookup DB or not. i.e., when the enableLookup is true, the system will initially refer to the Database to fetch contents. Note - By default, the enableLookup= false. |
debugMode | boolean | No | The Debug parameter will provide log details about localized content. The details provided are the entity code, localization process type, and more. This information is useful to capture the log and analyze the system performance. Note By default, the debugMode= false |
nmtMask | boolean | No | The feature to screen the non-dictionary words used in a sentence. In other words, the mask will indicate the words that should not be translated into the target language. Note - By default, the nmtMask = false Note - To set the nmtMask = true, it is mandatory the src_lang = en (English). |
nmtMaskTerms | array of content | No | Determines the Words that are to be masked. Note - On defining values in the nmtMaskTerms, then automatically the nmtMask is set to true. Example - Masking a term - "nmtMaskTerms": ["Reverie Language Technologies"] Here, the API will mask the term Reverie Language Technologies, if found in the source content, and will transliterate the word. |
Response
Element | Type | Description |
---|---|---|
responseList | array of content | The API will return the string(s) in the target language(s). |
inString | string | The input text in the source language. |
outString | string | The localized content in the requested target language(s). |
api_status | integer | Status of API Moderated / Partial /Unmoderated (Aggregate of all segments). Refer to API Messages to know about the available api_status and its description. |
status | string | Error status code for the invalid request. Note The status is shown only for the invalid request. |
error_cause | string | A Human-readable error message. Refer to API Messages to know more about the error messages and description. |
tokenConsumed | integer | The payload length served by NMT. Note - if LookUp DB serves the payload and if the content is moderated, then the tokenConsumed = zero 0. |
Handling Error
The Localization API raises exceptions for many reasons, such as failed conversions, invalid parameters, authentication errors, and network unavailability. It will provide more specific machine-readable messages with an error response so that users can react to errors more effectively.
Refer to: API Messages section to know the error code and corresponding messages.
Last updated