Get Collection Options
This endpoint retrieves a simplified list of collections for use in dropdown menus and selection interfaces.
Endpoint
GET /api/collection-options
Authentication
Authentication is required. User must have admin or creator role.
Response
Success Response
- Status Code: 200 OK
- Content: Array of simplified collection objects
[
{
"id": 123,
"name": "Workshop Sessions",
"UserId": 456
},
{
"id": 124,
"name": "Monthly Webinars",
"UserId": 789
},
{
"id": 125,
"name": "Course Materials",
"UserId": 456
}
]
Error Response
- Status Code: 403 Forbidden
- Content: Error message if the user doesn't have permission
{
"error": "Access denied"
}
- Status Code: 500 Internal Server Error
- Content: Error message for server errors
{
"error": "Something went wrong"
}
Notes
- This endpoint returns only the essential collection information needed for selection interfaces.
- Collections are returned for the platform associated with the authenticated user.
- The response is ordered by the collection's position in ascending order.
- This endpoint is commonly used when creating or editing content to select which collection(s) the content should belong to.
- The
UserIdfield can be used to identify collections created by the current user.
Example
curl -X GET "https://api.tribesocial.io/api/collection-options" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN"