APIGiới thiệu
Xác thực
Cách xác thực request API bằng API Key với Fleetwork.
Định dạng API Key
API Key của Fleetwork là chuỗi hex dài 48 ký tự:
Text
a3f92c1d8b0e5f7a29d4c6e1b8f03a7d2c9e5b1f4a8d3c6eCách xác thực
Truyền API Key qua HTTP header API-KEY:
Shell
curl -X GET \
"https://live.fleetwork.vn/api/v1/workspace/jobs" \
-H "API-KEY: a3f92c1d8b0e5f7a29d4c6e1b8f03a7d2c9e5b1f4a8d3c6e"Ví dụ JavaScript
JavaScript
const apiKey = "a3f92c1d8b0e5f7a29d4c6e1b8f03a7d2c9e5b1f4a8d3c6e";
const response = await fetch(
"https://live.fleetwork.vn/api/v1/workspace/jobs",
{
headers: {
"API-KEY": apiKey,
"Content-Type": "application/json",
},
},
);
const data = await response.json();Các loại môi trường
| Giá trị | Môi trường |
|---|---|
1 | Development |
2 | Production |
Khoá có thể bị giới hạn trong một môi trường cụ thể. Khoá Production không thể dùng cho môi trường Development và ngược lại.