Content API#
API lay noi dung voi variants, media, tags va metadata.
Base URL: https://app.socialking.vn/api/v1
Rate Limit: 1000 req/sec
1. Lay Content theo ID#
GET /content/get-by-id/:id
#
Auth: API Key
URL Params: id (UUID)
Response (200):
{
"success": true,
"content": {
"id": "content-uuid",
"status": "active",
"title": "Content Title",
"type": "social",
"action_type": "post_timeline",
"content_data": {
"type": "social",
"variant_usage_mode": "random",
"variants": [
{
"id": "variant-uuid",
"content": "Noi dung bai dang #hashtag",
"mediaIds": ["media-uuid-1"],
"media_count": 1,
"media_usage_mode": "random",
"weight": 1,
"order": 0,
"isUsed": false,
"lastUsedAt": "2026-03-30T10:00:00Z",
"media": [
{
"id": "media-uuid",
"url": "https://cdn.socialking.vn/media/image.jpg",
"filename": "image.jpg",
"mime_type": "image/jpeg",
"size_bytes": "102400",
"duration_sec": null
}
]
}
]
},
"tags": [
{
"id": "tag-uuid",
"name": "marketing"
}
],
"fbAccount": {
"id": "account-uuid",
"name": "Account Name",
"uid": "123456789",
"status": "live"
},
"createdAt": "2026-03-30T10:00:00Z",
"updatedAt": "2026-03-30T10:00:00Z",
"_count": {
"tags": 1,
"variants": 2,
"total_media": 3,
"folders": 1,
"unused_variants": 0
}
}
}Content Data Fields:
| Field | Type | Mo ta |
|---|---|---|
type | string | social | wordpress |
variant_usage_mode | string | random | sequential | weighted |
variants[].content | string | Noi dung van ban |
variants[].mediaIds | UUID[] | Media IDs dinh kem |
variants[].media_usage_mode | string | random - cach chon media |
variants[].weight | number | Trong so (cho mode weighted) |
variants[].isUsed | boolean | Da su dung chua |
Errors:
| Code | Mo ta |
|---|---|
| 404 | Content khong ton tai |