Social — Register#

Giai đoạn đầu tiên: Đăng ký tài khoản trên các site social được chỉ định (schema entity-style: first_name/last_name/phone/address/avatar).

Base URL: https://manager.likepion.com/api/v1/social_account


1. Lấy danh sách task #

curl -X GET 'https://manager.likepion.com/api/v1/social_account/links?limit=5&status=register' \
  -H 'X-API-Key: <api_key>'
ParamMặc địnhMô tả
limit5Số task muốn pull (tối đa 1000)
statusLọc theo trạng thái task (register)

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 social target
websiteWebsite khách hàng
email / usernameEmail / username register
pass_mail / twofa / app_passwordCredentials Gmail + TOTP + app password
passwordMật khẩu tạo 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. Bắt buộc gửi status để Assign verify task đang đúng phase mày mong đợi (tránh worker xử lý nhầm task đã chuyển status). Không thay đổi DB.

curl -X GET 'https://manager.likepion.com/api/v1/social_account/links/TASK_ID?status=register' \
  -H 'X-API-Key: <api_key>'
ParamBắt buộcMô tả
statusTrạng thái mong đợi của task (register | registering). Nếu task đang ở status khác → HTTP 409.

Response#

Trả về 1 object (không bọc trong mảng) — schema giống bước 1.

{ "success": true, "data": { ...task fields... } }
LỗiMô tả
task not found404Task không tồn tại hoặc đã soft-delete
status mismatch409Task đang ở status khác với status truyền vào

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
curl -X POST 'https://manager.likepion.com/api/v1/social_account/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ừ registeringcompleted. Đây là bước cuối cùng (không có phase connect).

⚠️ Lưu ý: body Test mặc định chứa placeholder dạng <...>. Phải thay placeholder bằng giá trị thực trước khi Send.

Server-side validation: Assign TỪ CHỐI 400 nếu body chứa giá trị mẫu (<...>, example-social.com, socuser01, yourdomain, <URL_*>…). Worker sẽ thấy lỗi rõ ràng placeholder rejected, không có cách nào lưu nhầm vào DB.

Trạng thái trướcTrạng thái sau
registeringcompleted
curl -X POST 'https://manager.likepion.com/api/v1/social_account/links/<task_id>/complete' \
  -H 'X-API-Key: <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "email": "<EMAIL_THỰC_VỪA_TẠO>",
    "username": "<USERNAME>",
    "password": "<PASSWORD>",
    "cookie": "<COOKIE_NẾU_CÓ>",
    "link_profile": "<URL_PROFILE_TRÊN_SITE>",
    "note": "Account + profile updated"
  }'
FieldBắt buộcMô tả
email / username / password / cookieÍt nhất 1 field credentials thực để lưu account vào pool
link_profileURL profile account trên site (ví dụ https://deviantart.com/u/username). Assign lưu vào social_account.link_profile để phase post sau này reference.
noteGhi chú (tuỳ chọn)

Response#

{ "success": true }

5. Báo thất bại #

Social account không có retry — fail là terminal. Worker gửi status để phân biệt:

Trạng thái trướcTrạng thái sauKhi nào dùng
registeringfinal_failed (mặc định)Account chưa tạo được (email exists, captcha, site down…) — không retry
registeringactive (gửi status: "profile_failed")Account đã tạo xong, chỉ lỗi update profile → coi như thành công, account vẫn usable cho phase post
curl -X POST 'https://manager.likepion.com/api/v1/social_account/links/<task_id>/fail' \
  -H 'X-API-Key: <api_key>' \
  -H 'Content-Type: application/json' \
  -d '{
    "status": "profile_failed",
    "link_profile": "https://deviantart.com/u/username",
    "error_message": "Avatar upload rejected"
  }'
FieldBắt buộcMô tả
error_messageMô tả ngắn lỗi (≤1000 ký tự)
statusregister_failed | profile_failed (default)
link_profileURL profile (nếu account đã tạo được dù profile fail)
noteGhi chú

Response#

{ "success": true }