Reverie API Documentation
  • Reverie APIs
  • Reference
    • Localization API
      • Setup
      • API Reference
      • Supported Languages
      • Supported Domains
      • API Messages
    • Transliteration API
      • Setup
      • API Reference
      • Language Codes
      • Supporting Domains
      • API Messages
    • Text to Speech API
      • Setup
      • API Reference
      • SSML (Speech Synthesis Markup Language)
      • Phoneme Reference
      • API Default Behaviour
      • Supporting Speaker Code
      • Supporting Sampling Rate
      • Supporting Audio Format
      • API Messages
    • Speech to Text | Streaming API
      • Setup
      • API Reference
      • Language Codes
      • Supporting Audio Format
      • Supporting Domains
      • API Messages
  • Speech to Text | File API
    • Setup
    • API Reference
    • Language Codes
    • Supporting Audio Format
    • API Messages
  • Speech to Text | Batch API
    • Setup
    • API Reference
    • Language Codes
    • Sample Request Responses
    • Supporting Audio Format
  • Language Identification API
    • Sample Code
    • API Reference
    • Language Codes
  • Reverie Products
    • Swalekh
    • Vachak
Powered by GitBook
On this page
  • Request URL
  • Header
  • Request
  • Response
  • Handling Error
  1. Reference
  2. Localization API

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

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”

domain

The Domain refers to the universe in which you use the Transliteration API. Example- Health Care, Insurance, Legal, etc.

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= true

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= true.

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.

filterProfane

boolean

No

Specify whether you want to filter out profane content from the input. Note - By default, the filterProfane=true.

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).

apiStatus

integer

api_statuses

Map<String, Integer>

status

string

Error status code for the invalid request.

Note The status is shown only for the invalid request.

msg

string

A Human-readable error message.

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.

uuid

string

It is a 128-bit Universally Unique Identifier. It is likely being used for tracking a request in the localization API.

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.

{ 
    "documentation": "http://beta.revup.reverieinc.com/dashboard/documentation", 
    "message": "Oops! something wrong happened", "error_cause": 
    "Target language is mandatory", 
    "status": "BAD_REQUEST" 
}

PreviousSetupNextSupported Languages

Last updated 28 days ago

Mention the ISO Language code of the input text. Refer for valid language code.

Mention the ISO Language code of the target language. Refer to for valid language code.

Mention the domain ID. Refer to Supporting Domain in section for valid domain ID. Note - The default domain 1

Status of API Moderated / Partial /Unmoderated (Aggregate of all segments). Refer to to know about the available apiStatus and its description.

A dictionary/object with language codes as keys and integer status codes as values. Represents the status of the API output for each language, indicating the moderation level of the response content. Each key is a language code (e.g.,”hi” for Hindi,”ta” for Tamil), and each value is an integer status code representing the moderation level. Note: This api_statuses field will be displayed only if multiple languages are requested in the same API payload. Refer to for valid language code. Refer to section to know about the available apiStatus and its description.

Refer to to know more about the error messages and description.

Supported Languages
Supported Languages
Localization API
API Messages
API Messages
Supported Languages
API Messages