Entity — Register#
Giai đoạn đầu tiên: Đăng ký tài khoản trên các site được chỉ định. Giai đoạn này xác nhận việc tạo tài khoản thành công để sẵn sàng cho bước thiết lập profile.
Base URL: https://manager.likepion.com/api/v1/entity
1. Lấy danh sách task #
# Không gửi status → trả cả register + connect (worker tự xử lý theo status từng task)
curl -X GET 'https://manager.likepion.com/api/v1/entity/links?limit=5' \
-H 'X-API-Key: <api_key>'
# Lọc riêng từng phase (tuỳ chọn):
curl -X GET 'https://manager.likepion.com/api/v1/entity/links?limit=5&status=register' \
-H 'X-API-Key: <api_key>'| Param | Mặc định | Mô tả |
|---|---|---|
limit | 5 | Số task muốn pull (tối đa 1000) |
status | (cả register + connect) | Lọc theo trạng thái task. Không gửi → trả về cả 2 phase. Gửi register chỉ task phase 1, gửi connect chỉ task phase 2 (account xong, đang chờ gán social_connect). |
💡 Khuyến nghị: Worker nên KHÔNG gửi
statusđể pull cả 2 phase, sau đó dispatch dựa vào fieldstatustrong từng task response. Tránh phải gọi 2 endpoint riêng cho register/connect.
Response#
{
"success": true,
"data": [
{
"id": "a1b2c3d4-5678-90ab-cdef-1234567890ab",
"request_id": "f0e1d2c3-b4a5-6789-0abc-def123456789",
"domain": "example-social.com",
"website": "https://likepion.com",
"email": "socuser@gmail.com",
"username": "socuser01",
"pass_mail": "xxxx xxxx xxxx xxxx",
"twofa": "JBSWY3DPEHPK3PXP",
"app_password": "xxxx xxxx xxxx xxxx",
"password": "Abc123!@xyzQ",
"first_name": "Minh",
"last_name": "Ngoc",
"phone": "0987654321",
"address": "123 ABC",
"location": "HCM",
"about": "<p>Bio HTML with {spin|syntax}</p>",
"avatar_url": "https://s3.likepion.com/avatars/abc.jpg",
"cover_url": "https://s3.likepion.com/covers/xyz.jpg",
"social_connect": [
"https://twitter.com/seouser01",
"https://facebook.com/seouser01",
"https://linkedin.com/in/seouser01",
"https://youtube.com/@seouser01"
]
}
]
}Giải thích fields#
| Field | Mô tả |
|---|---|
id | ID task — dùng khi gọi start/complete/fail |
request_id | ID request cha |
domain | Site cần đăng ký |
website | Website khách hàng |
email / username | Email / username register |
pass_mail / twofa / app_password | Credentials Gmail + TOTP + app password |
password | Mật khẩu tài khoản (đã được hệ thống gen sẵn) |
first_name, last_name | Họ tên profile |
phone, address, location | Thông tin liên hệ |
about | Bio/Mô tả (đã xử lý spin) |
avatar_url, cover_url | S3 URL ảnh |
social_connect | Danh sách link social cần gắn (Array of strings) |
images | Danh sách ảnh (dạng array gom nhóm avatar/cover) |
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/entity/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 từ register → registering.
| Trạng thái trước | Trạng thái sau |
|---|---|
register | registering |
Lưu ý: API chỉ chấp nhận task có
status = register. Task ở trạng thái khác sẽ bị từ chối.
curl -X POST 'https://manager.likepion.com/api/v1/entity/links/<task_id>/start' \
-H 'X-API-Key: <api_key>'Response#
{ "success": true }4. Báo hoàn thành #
Báo đăng ký thành công — task chuyển từ registering → profiled. Worker cần hoàn tất auth + tạo profile + chèn backlink trong 1 lần call (entity đã đơn giản hoá, không còn intermediate registered).
| Trạng thái trước | Trạng thái sau |
|---|---|
registering | profiled |
curl -X POST 'https://manager.likepion.com/api/v1/entity/links/<task_id>/complete' \
-H 'X-API-Key: <api_key>' \
-H 'Content-Type: application/json' \
-d '{
"link_profile": "https://example-social.com/u/seouser01",
"email": "socuser@gmail.com",
"username": "socuser01",
"password": "Abc123!@xyzQ",
"note": "Account created + profile updated"
}'| Field | Bắt buộc | Mô tả |
|---|---|---|
link_profile | ✔ | URL trang profile vừa tạo (home/profile URL của account trên site) |
email | Cập nhật email thực tế đã đăng ký (nếu khác với gợi ý ban đầu) | |
username | Cập nhật username đã đăng ký | |
password | Cập nhật password (nếu site bắt buộc đổi / đặt khác với gợi ý) | |
note | Ghi chú (tuỳ chọn) |
Response#
{ "success": true }5. Báo thất bại #
Task chuyển từ registering sang status lỗi tương ứng. Worker có thể gửi thêm field status trong body để chọn status đích (mặc định register_failed). Retry manager sẽ tự động re-queue nếu retry_count < max_retries.
| Trạng thái trước | Trạng thái sau | Khi nào dùng |
|---|---|---|
registering | register_failed | Lỗi khi tạo tài khoản (email đã tồn tại, captcha fail, site down…) |
registering | profile_failed | Tài khoản đã tạo nhưng lỗi khi cập nhật bio/avatar/cover/backlink |
curl -X POST 'https://manager.likepion.com/api/v1/entity/links/<task_id>/fail' \
-H 'X-API-Key: <api_key>' \
-H 'Content-Type: application/json' \
-d '{
"status": "profile_failed",
"error_message": "Avatar upload rejected by site",
"note": "account_created_but_profile_not_updated"
}'| Field | Bắt buộc | Mô tả |
|---|---|---|
error_message | ✔ | Mô tả ngắn lỗi (≤1000 ký tự) |
status | register_failed (mặc định) | profile_failed — chọn loại lỗi theo phase đang xử lý | |
note | Ghi chú thêm |
Response#
{ "success": true }