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:

FieldTypeMo ta
typestringsocial | wordpress
variant_usage_modestringrandom | sequential | weighted
variants[].contentstringNoi dung van ban
variants[].mediaIdsUUID[]Media IDs dinh kem
variants[].media_usage_modestringrandom - cach chon media
variants[].weightnumberTrong so (cho mode weighted)
variants[].isUsedbooleanDa su dung chua

Errors:

CodeMo ta
404Content khong ton tai