Skip to content

GET /v1/collections/:collectionId

Retrieve a single collection by ID, including all content items. This is the primary endpoint for fetching content to display in broadcast graphics.

Request

bash
curl -H "X-API-Key: your-api-key" \
  https://api.interplai.app/v1/collections/col_abc123
javascript
const response = await fetch(
  'https://api.interplai.app/v1/collections/col_abc123',
  { headers: { 'X-API-Key': 'your-api-key' } }
);
const collection = await response.json();

Path parameters

ParameterTypeDescription
collectionIdstringUnique collection identifier

Response

json
{
  "id": "col_abc123",
  "name": "Match Day Social Feed",
  "contentType": "SOCIAL_POST",
  "stagingContentCount": 1,
  "liveContentCount": 2,
  "createdDate": "2026-01-10T08:00:00.000Z",
  "lastModifiedDate": "2026-01-18T10:35:00.000Z",
  "stagingContents": [
    {
      "id": "content_001",
      "fullName": "Sophie Hammer",
      "username": "sophiehammer",
      "source": "FACEBOOK",
      "message": "What a strike! Absolutely incredible goal",
      "profileImageUrl": "https://graph.facebook.com/sophie_h/picture",
      "media": [
        {
          "mediaUrl": "https://media.dizplai.com/social-media/2026/01/fb/0.jpg",
          "mediaType": "image/jpeg"
        }
      ],
      "publishedAt": "2026-01-18T10:30:00.000Z",
      "lastModifiedDate": "2026-01-18T10:35:00.000Z"
    }
  ],
  "liveContents": [
    {
      "id": "content_002",
      "fullName": "James Rodriguez",
      "username": "@jamesrodriguez",
      "source": "WHATSAPP",
      "message": "Unbelievable atmosphere at the stadium tonight! #MatchDay",
      "profileImageUrl": "https://example.com/profile/james_r.jpg",
      "media": [],
      "publishedAt": "2026-01-18T10:28:00.000Z",
      "lastModifiedDate": "2026-01-18T10:35:00.000Z"
    },
    {
      "id": "content_003",
      "fullName": "Premier League",
      "username": "@premierleague",
      "source": "INSTAGRAM",
      "message": "GOAL! What a way to open the scoring",
      "profileImageUrl": "https://instagram.com/pl_avatar.jpg",
      "media": [
        {
          "mediaUrl": "https://media.dizplai.com/social-media/2026/01/ig/goal.mp4",
          "mediaType": "video/mp4"
        }
      ],
      "publishedAt": "2026-01-18T10:25:00.000Z",
      "lastModifiedDate": "2026-01-18T10:35:00.000Z"
    }
  ],
  "meta": {
    "totalItems": 3,
    "page": 0,
    "pageSize": 3
  }
}

Response fields

Collection

FieldTypeDescription
idstringUnique collection identifier
namestringCollection display name
contentTypestringContent type (see Content Types)
stagingContentCountintegerNumber of staging content items
liveContentCountintegerNumber of live content items
createdDatestringISO 8601 creation timestamp
lastModifiedDatestringISO 8601 last update timestamp
stagingContentsarrayArray of staging content items
liveContentsarrayArray of live content items
metaobjectPagination metadata

Content item

FieldTypeDescription
idstringUnique content item identifier
fullNamestring | nullAuthor display name
usernamestring | nullAuthor handle (e.g. @techwriter)
sourcestringSource platform (see Sources)
messagestringThe post text content
profileImageUrlstring | nullAuthor avatar URL
mediaarrayAttached media items
publishedAtstringISO 8601 original publish timestamp
lastModifiedDatestringISO 8601 last update timestamp

Media item

FieldTypeDescription
mediaUrlstringURL to the media asset
mediaTypestringMIME type (e.g. image/jpeg, video/mp4)

Conditional requests (ETags)

The response includes an ETag header. Use it with If-None-Match to avoid re-downloading unchanged data:

bash
# First request — note the ETag in the response
curl -i -H "X-API-Key: your-api-key" \
  https://api.interplai.app/v1/collections/col_abc123
# Response includes: ETag: "2026-01-18T10:35:00.000Z"

# Subsequent request — send the ETag back
curl -H "X-API-Key: your-api-key" \
  -H 'If-None-Match: "2026-01-18T10:35:00.000Z"' \
  https://api.interplai.app/v1/collections/col_abc123
# Returns 304 Not Modified if unchanged

See Caching for more details.

Error responses

StatusCodeDescription
401MISSING_API_KEY / INVALID_API_KEYAuthentication failure
404COLLECTION_NOT_FOUNDCollection does not exist
502BAD_GATEWAYUpstream service error
503SERVICE_UNAVAILABLEService temporarily unavailable

Interplai API v1.2.0