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>'
ParamMặc địnhMô tả
limit5Số 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 field status trong 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#

FieldMô tả
idID task — dùng khi gọi start/complete/fail
request_idID request cha
domainSite cần đăng ký
websiteWebsite khách hàng
email / usernameEmail / username register
pass_mail / twofa / app_passwordCredentials Gmail + TOTP + app password
passwordMật khẩu tài khoản (đã được hệ thống gen sẵn)
first_name, last_nameHọ tên profile
phone, address, locationThông tin liên hệ
aboutBio/Mô tả (đã xử lý spin)
avatar_url, cover_urlS3 URL ảnh
social_connectDanh sách link social cần gắn (Array of strings)
imagesDanh 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ừ registerregistering.

Trạng thái trướcTrạng thái sau
registerregistering

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ừ registeringprofiled. 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ướcTrạng thái sau
registeringprofiled
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"
  }'
FieldBắt buộcMô tả
link_profileURL trang profile vừa tạo (home/profile URL của account trên site)
emailCập nhật email thực tế đã đăng ký (nếu khác với gợi ý ban đầu)
usernameCập nhật username đã đăng ký
passwordCập nhật password (nếu site bắt buộc đổi / đặt khác với gợi ý)
noteGhi 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ướcTrạng thái sauKhi nào dùng
registeringregister_failedLỗi khi tạo tài khoản (email đã tồn tại, captcha fail, site down…)
registeringprofile_failedTà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"
  }'
FieldBắt buộcMô tả
error_messageMô tả ngắn lỗi (≤1000 ký tự)
statusregister_failed (mặc định) | profile_failed — chọn loại lỗi theo phase đang xử lý
noteGhi chú thêm

Response#

{ "success": true }