Facebook Cooldown API#

API cấu hình cooldown (thời gian chờ) giữa các action trên Facebook.

Base URL: https://app.socialking.vn/api/v1


1. Danh sách Cooldown#

GET /social/fb/cooldown/get-all #

Auth: Bearer Token (JWT)

Query Parameters:

ParamTypeDefaultMô tả
_pagenumber1Trang
_limitnumber20Items/trang
_orderstringdescasc | desc
_searchstring-Tìm kiếm

2. Chi tiết Cooldown#

GET /social/fb/cooldown/get-by-id/:id #

Auth: Bearer Token (JWT)

URL Params: id (UUID)


3. Tạo Cooldown#

POST /social/fb/cooldown/create #

Auth: Bearer Token (JWT)

Request Body:

{
  "actionType": "like",
  "min_delay": 5,
  "max_delay": 15,
  "hourly_limit": 30,
  "daily_limit": 200,
  "energy_cost": 1,
  "description": "Like cooldown config",
  "enabled": true
}
FieldTypeRequiredValidation
actionTypeActionTypeYesEnum loại action
poolIdUUIDNoNullable, Pool ID
min_delaynumberYesInteger >= 0 (giây)
max_delaynumberYesInteger >= 0, >= min_delay
hourly_limitnumberNoInteger >= 1, nullable
daily_limitnumberNoInteger >= 1, nullable
energy_costnumberNoInteger >= 0, default 1
descriptionstringNoMax 500 ký tự, nullable
enabledbooleanNoDefault true

Response (201):

{
  "success": true,
  "data": {
    "id": "uuid-string",
    "actionType": "like",
    "min_delay": 5,
    "max_delay": 15,
    "hourly_limit": 30,
    "daily_limit": 200,
    "energy_cost": 1,
    "enabled": true
  }
}

4. Tạo nhiều Cooldown#

POST /social/fb/cooldown/bulk-create #

Auth: Bearer Token (JWT)

Rate Limit: 10 req/sec

Request Body:

{
  "items": [
    { "actionType": "like", "min_delay": 5, "max_delay": 15 },
    { "actionType": "comment", "min_delay": 10, "max_delay": 30 }
  ],
  "skipDuplicates": true
}
FieldTypeRequiredValidation
itemsarrayYes1-100 items
skipDuplicatesbooleanNoDefault true

5. Cập nhật Cooldown#

PUT /social/fb/cooldown/update/:id #

Auth: Bearer Token (JWT)

URL Params: id (UUID)

Request Body: Các fields giống tạo, tất cả optional.


6. Cập nhật nhiều Cooldown#

PATCH /social/fb/cooldown/bulk-update #

Auth: Bearer Token (JWT)

Rate Limit: 10 req/sec

Request Body:

{
  "items": [
    { "id": "uuid-1", "min_delay": 10, "max_delay": 25 }
  ]
}

7. Xóa Cooldown#

POST /social/fb/cooldown/delete #

Auth: Bearer Token (JWT)

Request Body:

{
  "ids": ["uuid-1", "uuid-2"]
}

8. Reset về mặc định#

POST /social/fb/cooldown/reset #

Auth: Bearer Token (JWT)

Rate Limit: 5 req/sec

Response (200):

{
  "success": true,
  "message": "Default cooldowns reset"
}