Link Cloud#
Worker upload trang SEO tĩnh lên các nền tảng cloud miễn phí (GitHub Pages, Netlify, Cloudflare Pages, Google Sites…). Assign đã render sẵn HTML hoàn chỉnh (theme + title + content), worker upload nguyên văn không sửa.
Base URL: https://manager.likepion.com/api/v1/link_cloud
Content mode (ai hoặc manual) được xử lý phía assign — worker không cần biết, chỉ nhận html đã render xong.
1. Lấy danh sách task #
curl -X GET 'https://manager.likepion.com/api/v1/link_cloud/links?limit=5' \
-H 'X-API-Key: <api_key>'| Param | Mặc định | Mô tả |
|---|---|---|
limit | 5 | Số task muốn pull (tối đa 1000) |
Response#
{
"success": true,
"data": [
{
"id": "fc394939-2d8f-4048-808c-f55f3576cb1c",
"request_id": "2cfa23cb-811a-4772-bf2c-d1a25cfe8e8e",
"domain": "github.io",
"name_domain": "likepion-seo",
"name_page": "dich-vu-seo-top-google",
"html": "<!DOCTYPE html><html lang=\"vi\"><head>...</head><body>...full rendered page...</body></html>",
"account": {
"id": "uuid-link-cloud-account",
"name": "Tài khoản 1",
"api_key": "sk-..."
}
}
]
}Giải thích fields#
| Field | Mô tả |
|---|---|
id | ID task |
request_id | ID request cha |
domain | Nền tảng cloud (github.io, netlify.app, pages.dev, sites.google.com…) |
name_domain | Tên miền con / repo name để tool tạo trang (ví dụ GitHub Pages repo name) |
name_page | Tên trang / slug URL (ví dụ dich-vu-seo-top-google) |
html | HTML hoàn chỉnh — upload thẳng không sửa |
account | Object {id, name, api_key} của Link Cloud account assign cho task. Rotation per-request: 1 request = 1 account, TẤT CẢ task (mọi domain) trong cùng request dùng CHUNG account này. Rotation across requests theo created_at order. Vd có 3 account: request thứ 1 = account 1, request thứ 2 = account 2, request thứ 3 = account 3, request thứ 4 = account 1, … null nếu không có active account nào trong link_cloud_accounts |
2. Lấy chi tiết task #
Lấy thông tin 1 task cụ thể theo id. Không cần filter server/status. Không thay đổi DB.
curl -X GET 'https://manager.likepion.com/api/v1/link_cloud/links/TASK_ID' \
-H 'X-API-Key: <api_key>'Response#
Trả về 1 object (không bọc trong mảng) — schema giống bước 1.
{ "success": true, "data": { ...task fields... } }Nếu task không tồn tại hoặc đã soft-delete → HTTP 404 {"success": false, "message": "task not found"}.
3. Báo đang xử lý #
Sau khi pull task, bắt buộc gọi API này để chuyển task sang trạng thái running. Assign tự set started_at = NOW() (idempotent — gọi lại nhiều lần không đổi).
curl -X POST 'https://manager.likepion.com/api/v1/link_cloud/links/<task_id>/start' \
-H 'X-API-Key: <api_key>'Response#
{ "success": true }4. Báo hoàn thành #
curl -X POST 'https://manager.likepion.com/api/v1/link_cloud/links/<task_id>/complete' \
-H 'X-API-Key: <api_key>' \
-H 'Content-Type: application/json' \
-d '{
"link_post": "https://digital-seo-guide.github.io/"
}'| Field | Bắt buộc | Mô tả |
|---|---|---|
link_post | ✔ | URL trang đã upload (root domain hoặc sub-path) |
note | Ghi chú (tuỳ chọn) |
Response#
{ "success": true }5. Báo thất bại #
curl -X POST 'https://manager.likepion.com/api/v1/link_cloud/links/<task_id>/fail' \
-H 'X-API-Key: <api_key>' \
-H 'Content-Type: application/json' \
-d '{
"error_message": "GitHub Pages build failed: invalid HTML"
}'| Field | Bắt buộc | Mô tả |
|---|---|---|
error_message | ✔ | Mô tả ngắn lỗi (≤1000 ký tự) |
note | Ghi chú thêm |
Response#
{ "success": true }