Get Supported Languages
This endpoint retrieves the list of supported languages for campaign creation in Toingg.
- Endpoint URL:
GET https://www.toingg.com/api/v3/get_supported_languages
- Headers:
accept: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
Example cURL Request
curl -X GET "https://www.toingg.com/api/v3/get_supported_languages" -H "accept: application/json" -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
Example Code
Python
import requests
url = "https://www.toingg.com/api/v3/get_supported_languages"
headers = {
"accept": "application/json",
"Authorization": "Bearer YOUR_ACCESS_TOKEN"
}
response = requests.get(url, headers=headers)
if response.status_code == 200:
data = response.json()
print("Supported Languages:", data["result"]["languages"])
else:
print("Error:", response.status_code, response.text)
JavaScript
const axios = require('axios');
const url = 'https://www.toingg.com/api/v3/get_supported_languages';
const headers = {
'accept': 'application/json',
'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
};
axios.get(url, { headers })
.then(response => {
if (response.status === 200) {
console.log('Supported Languages:', response.data.result.languages);
} else {
console.log('Error:', response.status, response.statusText);
}
})
.catch(error => {
console.error('Error:', error);
});
Server Response
- Status Code:
200 OK
- Response Body:
{
"status": true,
"message": "Campaign created",
"result": {
"languages": [
"english",
"english-au",
"english-in",
"english-us",
"french",
"german",
"hindi",
"portuguese",
"russian",
"spanish",
"swedish"
]
}
}
This documentation provides detailed information on how to retrieve supported languages using the Toingg API. Each section includes example code snippets in both Python and JavaScript to help developers integrate these endpoints into their applications.