Skip to main content

Get Collection by ID

This endpoint retrieves detailed information about a specific collection by its unique identifier.

Endpoint

GET /api/collection-by-id/:id

Authentication

Authentication is required. Any authenticated user can access this endpoint.

Path Parameters

ParameterTypeDescription
idIntegerUnique identifier of the collection to retrieve

Query Parameters

ParameterTypeDefaultDescription
showFutureStringSet to "true" to include content with a future publishedDate.

Response

Success Response

  • Status Code: 200 OK
  • Content: Detailed collection object with its associated content items
{
"id": 110,
"name": "Jan 2021 Workshop Sessions",
"description": "<p><br></p>",
"descriptionPlain": "",
"descriptionHtml": "",
"slug": "workshop-sessions",
"collectionBGImage": "1631554500904-Facebook-Cover_centered.png",
"position": -2,
"expireDate": null,
"publishedDate": null,
"collectionType": "default",
"sortPreference": "most recent first",
"createdAt": "2021-02-03T19:24:52.000Z",
"updatedAt": "2022-03-03T06:42:31.000Z",
"PlatformId": 36,
"UserId": null,
"Contents": [
{
"id": 32,
"likeCount": 1,
"commentCount": 0,
"currentUserHasLiked": true,
"ContentCollection": {
"CollectionId": 231,
"ContentId": 32,
"position": 0,
"createdAt": "2022-10-20T17:29:50.000Z",
"updatedAt": "2022-10-20T17:29:50.000Z"
},
"ContentCollectionCollectionId": null,
"MediaUUID": null,
"PlatformId": 123,
"TopicCollectionCollectionId": null,
"User": null,
"UserId": null,
"chatEnabled": false,
"contentURI": null,
"description": "Test Content Description",
"descriptionPlain": "Test Content Description",
"descriptionHtml": "<p>Test Content Description</p>",
"featured": false,
"featuredImage": null,
"featuredImageAlt": null,
"ingestEndpoint": null,
"options": null,
"playbackId": null,
"position": 0,
"publishedDate": null,
"expireDate": null,
"slug": "test-content",
"title": "Test Content",
"type": "video",
"visibility": "public",
"createdAt": "2022-10-20T17:29:50.000Z",
"updatedAt": "2022-10-20T17:29:50.000Z"
}
// Additional content items...
]
}

Error Response

  • Status Code: 404 Not Found
  • Content: Error message if the collection doesn't exist
{
"error": "Collection not found"
}
  • Status Code: 500 Internal Server Error
  • Content: Error message for server errors
{
"error": "Something went wrong"
}

Notes

  • This endpoint returns the complete collection information including all associated content items.
  • The response includes user-specific information such as whether the current user has liked content items.
  • Content items include their position within the collection via the ContentCollection object.
  • The collection's content is returned in the order specified by the collection's sortPreference.
  • By default, content with a publishedDate in the future is excluded. Use ?showFuture=true to include scheduled content.

Example

curl -X GET "https://api.tribesocial.io/api/collection-by-id/110" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"