Languages
Localization / translations.
GET List Languages
GET https://api.greenbubble.io/api/languages
cURL
curl -X GET 'https://api.greenbubble.io/api/languages' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
GET Get Translations
GET https://api.greenbubble.io/api/languages/translations/en
cURL
curl -X GET 'https://api.greenbubble.io/api/languages/translations/en' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/translations/en', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/translations/en"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/translations/en');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
GET Get Language
GET https://api.greenbubble.io/api/languages/LANGUAGE_ID
cURL
curl -X GET 'https://api.greenbubble.io/api/languages/LANGUAGE_ID' \
-H 'x-api-key: YOUR_API_KEY'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/LANGUAGE_ID', {
method: 'GET',
headers: { 'x-api-key': 'YOUR_API_KEY' }
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/LANGUAGE_ID"
headers = { "x-api-key": "YOUR_API_KEY" }
response = requests.get(url, headers=headers)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/LANGUAGE_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['x-api-key: YOUR_API_KEY']);
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
POST Create Language
POST https://api.greenbubble.io/api/languages/create
cURL
curl -X POST 'https://api.greenbubble.io/api/languages/create' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"code":"fr","name":"French"}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/create', {
method: 'POST',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"code": "fr",
"name": "French"
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/create"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"code": "fr",
"name": "French"
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/create');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"code":"fr","name":"French"}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
PUT Update Language
PUT https://api.greenbubble.io/api/languages/LANGUAGE_ID
cURL
curl -X PUT 'https://api.greenbubble.io/api/languages/LANGUAGE_ID' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/LANGUAGE_ID', {
method: 'PUT',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/LANGUAGE_ID"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.put(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/LANGUAGE_ID');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
DELETE Delete Languages
DELETE https://api.greenbubble.io/api/languages/delete
cURL
curl -X DELETE 'https://api.greenbubble.io/api/languages/delete' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"ids":["LANGUAGE_ID"]}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/delete', {
method: 'DELETE',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"ids": [
"LANGUAGE_ID"
]
})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/delete"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {
"ids": [
"LANGUAGE_ID"
]
}
response = requests.delete(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/delete');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"ids":["LANGUAGE_ID"]}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
PATCH Toggle Language Status
PATCH https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-status
cURL
curl -X PATCH 'https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-status' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-status', {
method: 'PATCH',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-status"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.patch(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-status');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
PUT Update Translations
PUT https://api.greenbubble.io/api/languages/translations/en
cURL
curl -X PUT 'https://api.greenbubble.io/api/languages/translations/en' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/translations/en', {
method: 'PUT',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/translations/en"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.put(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/translations/en');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;
PATCH Toggle Default Language
PATCH https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-default
cURL
curl -X PATCH 'https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-default' \
-H 'x-api-key: YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{}'
JavaScript
const res = await fetch('https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-default', {
method: 'PATCH',
headers: {
'x-api-key': 'YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({})
});
const data = await res.json();
console.log(data);
Python
import requests
url = "https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-default"
headers = {
"x-api-key": "YOUR_API_KEY",
"Content-Type": "application/json",
}
payload = {}
response = requests.patch(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
PHP
$ch = curl_init('https://api.greenbubble.io/api/languages/LANGUAGE_ID/toggle-default');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'x-api-key: YOUR_API_KEY',
'Content-Type: application/json',
]);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{}');
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
echo $httpCode . "\n" . $response;