Get Collection Items
This endpoint is the primary way to display the content of a collection. It returns a paginated list of CollectionItem objects, each serving as a bridge between the collection and the actual referenced resource.
Using this endpoint allows for granular control over the display:
- Pagination: Ideal for long wishlists or large shopping carts.
- Polymorphism: A single list can contain different types of items, identifiable via the
itemTypefield. - Optimization: Use the
cachedDatafield to render names, images, and prices without additional API calls to the source resources.
X-API-Key<token>
In: header
Path Parameters
id*string
Query Parameters
filter?
limit?number
page?number
sort?string
populate?array<>
select?
skip?number
Response Body
application/json
curl -X GET "https://example.com/collections/string/items?sort=&populate="{ "type": "string", "code": "string", "message": "string", "data": { "docs": [ { "_id": "64f1a2b3c4d5e6f7g8h9i0j1", "item": { "_id": "64f1a2b3c4d5e6f7g8h9i0j2", "name": "Smartphone XYZ", "description": "Latest smartphone model", "productType": "electronics" }, "itemType": "Product", "itemId": "64f1a2b3c4d5e6f7g8h9i0j2", "collectionParent": { "_id": "64f1a2b3c4d5e6f7g8h9i0j3", "title": "My Wishlist", "type": "wishlist", "privacy": "private" }, "collectionId": "64f1a2b3c4d5e6f7g8h9i0j3", "owner": { "_id": "64f1a2b3c4d5e6f7g8h9i0j4", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" }, "ownerModel": "Profil", "metadata": { "position": 1, "priority": "high", "rating": 5, "quantity": 1, "addedBy": { "_id": "64f1a2b3c4d5e6f7g8h9i0j4", "firstName": "John", "lastName": "Doe", "email": "john.doe@example.com" }, "addedByType": "Profil", "addedAt": "2024-01-15T10:30:00Z", "tags": [ "electronics", "wishlist" ], "notes": "Really want this phone!" }, "status": "active", "payload": {}, "createdAt": "2024-01-15T10:30:00Z", "updatedAt": "2024-01-15T10:30:00Z" } ], "totalDocs": 0, "limit": 0, "totalPages": 0, "page": 0, "pagingCounter": 0, "hasPrevPage": true, "hasNextPage": true, "prevPage": 0, "nextPage": 0 }, "status": 0}