Matrix Translate API
This API allows you to translate given texts in a desired language.
Request: Translate text
Complete Endpoint:
GET
https://console.smartclean.io/_gapi/apis/apis.smartclean.translate/v1/_translate?op=apis.translateString &propid=<Property ID>&q=<Text to Translate>&s=<Source Language>&t=<Desired Language>
Where,
-
Method:
GET
-
Base URL:
https://console.smartclean.io
-
Path:
/_gapi/apis/apis.smartclean.translate/v1/_translate
-
Query String:
?op=apis.translateString&propid=<Property ID>&q=<Text to Translate>&s=<Source Language>&t=<Desired Language>
Parameters in query string:
- Text in the URL after “?” character is the query string that contains parameters to pass to the request.
- Set the operation name (“op” as “apis.translateString”)
- i.e.,
op=apis.translateString
- This is a constant, for our service to identify the request.
- i.e.,
- The following are variable query parameters, that you must specify:
propid=<Property ID>
: ID of your SmartClean enabled Propertyq=<string to translate>
: Provide the text to translates=<source language code>
: Enter language code (ISO-639-2) of the text you have provided (For example: "en" for English
)t=<target language code>
: Enter language code (ISO-639-2) of the desired text (For example: "es" for Spanish
)
- See the complete list of ISO-639 languages codes supported at: https://www.smartclean.io/matrix/assets/common/json/languages_2022_08_25.json
- Find out the ISO-639 code for your language here: https://www.loc.gov/standards/iso639-2/php/code_list.php
Headers:
Key | Value | Description |
---|---|---|
Authorization | Your SmartClean Access Token | (Required) Basic Auth / Access Token / SC-HMAC-V4 Signature (based on authentication type) |
x-sc-auth | Your SmartClean Application ID | (Optional) If you have registered your application with us for federated access |
Body:
No additional data / body required for this request.
Example Request:
URL:
https://console.smartclean.io/_gapi/apis/apis.smartclean.translate/v1/_translate?op=apis.translateString &propid=DemoProperty&q=hello&s=en&t=es
Where, following are values of the variable query parameters:
propid=DemoProperty
q=Hello
s=en
t=es
Response Body:
{
"data": {
"translations": [
{
"translatedText": "Hola"
}
]
}
}