Introduction
This documentation aims to provide all the information you need to work with our API.
<aside>As you scroll, you'll see code examples for working with the API in different programming languages in the dark area to the right (or as part of the content on mobile).
You can switch the language used with the tabs at the top right (or from the nav menu at the top left on mobile).</aside>
Authenticating requests
This API is not authenticated.
Ads
Get ads
Example request:
curl --request GET \
--get "https://flex-home.botble.com/api/v1/ads?keys[]=homepage-banner&keys[]=sidebar-banner" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"keys\": [
\"homepage-banner\",
\"sidebar-banner\"
]
}"
const url = new URL(
"https://flex-home.botble.com/api/v1/ads"
);
const params = {
"keys[0]": "homepage-banner",
"keys[1]": "sidebar-banner",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"keys": [
"homepage-banner",
"sidebar-banner"
]
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
Show headers
cache-control: no-cache, private
content-type: application/json
access-control-allow-origin: *
{
"error": false,
"data": [],
"message": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Languages
Get list of available languages
Example request:
curl --request GET \
--get "https://flex-home.botble.com/api/v1/languages" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://flex-home.botble.com/api/v1/languages"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": false,
"data": [
{
"lang_id": 1,
"lang_name": "English",
"lang_locale": "en",
"lang_code": "en_US",
"lang_flag": "us",
"lang_is_default": true,
"lang_is_rtl": false,
"lang_order": 0
},
{
"lang_id": 2,
"lang_name": "Vietnamese",
"lang_locale": "vi",
"lang_code": "vi",
"lang_flag": "vn",
"lang_is_default": false,
"lang_is_rtl": false,
"lang_order": 1
}
],
"message": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get current language
Example request:
curl --request GET \
--get "https://flex-home.botble.com/api/v1/languages/current" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
const url = new URL(
"https://flex-home.botble.com/api/v1/languages/current"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": false,
"data": {
"lang_id": 1,
"lang_name": "English",
"lang_locale": "en",
"lang_code": "en_US",
"lang_flag": "us",
"lang_is_default": true,
"lang_is_rtl": false,
"lang_order": 0
},
"message": null
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.