3. API Documentation
Endpoint: Check API Status
Request
- URL:
https://api.conveythis.com/public/status/
- Method:
GET
Response
- Body (JSON):
Field Name | Type | Description |
---|---|---|
status |
string | The status of the request (e.g., success or failure). |
message |
string | A message providing additional details about the response. |
data |
array | Reserved for additional data; currently empty. |
Example Response
{
"status": "success",
"message": "OK",
"data": []
}
Endpoint: Retrieve Supported Languages
Request
- URL:
https://api.conveythis.com/public/languages/
- Method:
GET
Response
- Body (JSON):
Field Name | Type | Description |
---|---|---|
status |
string | The status of the request (e.g., success or failure). |
message |
string | A message providing additional details about the response. |
data |
array | An array of supported languages. Each language contains: |
Language Data | ||
language_id |
string | Unique identifier for the language. |
title |
string | Name of the language in English. |
title_native |
string | Name of the language in its native script. |
code2 |
string | ISO 639-1 two-letter language code. |
code3 |
string | ISO 639-2 three-letter language code. |
flag |
string | Country code for the language's flag. |
Example Response
{
"status": "success",
"message": "OK",
"data": [
{
"language_id": "703",
"title": "English",
"title_native": "English",
"code2": "en",
"code3": "eng",
"flag": "us"
},
{
"language_id": "704",
"title": "Afrikaans",
"title_native": "Afrikaans",
"code2": "af",
"code3": "afr",
"flag": "za"
}
...
]
}
Endpoint: Check if Language Pair is Supported
Request
- URL:
https://api.conveythis.com/public/languages/is-supported/
-
Method:
POST
-
Headers:
Key | Value |
---|---|
Content-Type | application/json |
- Body (JSON):
Field Name | Type | Description |
---|---|---|
api_key |
string | Your public API key for authentication. |
languageFrom |
string | ISO 639-1 code for the source language. |
languageTo |
string | ISO 639-1 code for the target language. |
Example Request
{
"languageFrom": "en",
"languageTo": "es"
"api_key": "pub_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
Response
- Body (JSON):
Field Name | Type | Description |
---|---|---|
status |
string | The status of the request (e.g., success or failure). |
message |
string | A message providing additional details about the response. |
data |
object | Contains the is_supported field indicating support status. |
is_supported |
boolean | Whether the specified language pair is supported. |
Example Response
{
"status": "success",
"message": "OK",
"data": {
"is_supported": true
}
}
Endpoint: Translate Website Content
Request
- URL:
https://api.conveythis.com/translate/
-
Method:
POST
-
Headers:
Key | Value |
---|---|
Content-Type | application/json |
- Body (JSON):
Field Name | Type | Description |
---|---|---|
referrer |
string |
URL of the website initiating the translation request. |
target_language |
string |
Language code for the target translation (e.g., es for Spanish). |
segments |
array |
Array of text segments to translate. Each segment is a string. |
api_key |
string |
Your public API key for authentication. |
Example Request
{
"referrer": "https://example.com/",
"target_language": "es",
"segments": [
"I have been studying Spanish for several months, and I am starting to feel more confident.",
"The weather is perfect today, and we are planning to go for a walk in the park.",
"I really enjoy visiting new places and trying different foods whenever I travel."
],
"api_key": "pub_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
}
Response
- Body (JSON):
Field Name | Type | Description |
---|---|---|
status |
string |
Response status (e.g., success or failure). |
message |
string |
Details of the request status (e.g., OK for successful requests). |
data |
array |
Array of text segments to translate. Each segment is a string. |
api_key |
string |
Array of translation results. Each result contains source_text and translate_text . |
Example Response
{
"status": "success",
"message": "OK",
"data": [
{
"I have been studying Spanish for several months, and I am starting to feel more confident.",
"translate_text": "Llevo varios meses estudiando español y empiezo a sentirme más segura."
},
{
"source_text": "The weather is perfect today, and we are planning to go for a walk in the park.",
"translate_text": "Hoy hace un tiempo perfecto y vamos a dar un paseo por el parque."
},
{
"source_text": "I really enjoy visiting new places and trying different foods whenever I travel.",
"translate_text": "Siempre que viajo me gusta visitar sitios nuevos y probar comidas diferentes."
}
]
}