Collections group and filter the site's items. The prefix of the name is its kind: product/ is a top-level product category, grouping/ a filter inside one, service/ a service category, calendar-filter/ a filter on the booking page, blogpost/ a blog category, and so on. Collections can nest and can show their own page.
Endpoints that need a token: the site owner creates it in their admin (Developers > API reference). AI assistants: how to ask the user for one.
9 endpoints.
Categories and filters; ?type for one kind (product, service, blogpost...). Ordered by position, then name.
Public - no token needed.
Only collections with this type.
Returns a list of Collection objects.
curl -X GET 'http://bulgariandebateassociation.max-media.io/collections?ionic=true&type=...'
[
{
"name": "Example",
"parent_collection": "6543210fedcba98765432100",
"picture": "6543210fedcba98765432100",
"about_page": "6543210fedcba98765432100",
"match_to_option": false,
"is_color": false,
"color": "#3557c4",
"position": 1,
"items": [
"6543210fedcba98765432101"
],
"thumbnail": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100"
}
]Creates a category or filter, placed last in its kind's order; createNav also adds it to the navigation. The name's prefix says where it shows (product/, service/, blogpost/...; see the Collection model). Answers 201 with the category.
Needs a site admin token.
The collection's create nav.
Returns the Collection object.
curl -X POST 'http://bulgariandebateassociation.max-media.io/collections?ionic=true' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "createNav": "..." }'{
"name": "Example",
"parent_collection": "6543210fedcba98765432100",
"picture": "6543210fedcba98765432100",
"about_page": "6543210fedcba98765432100",
"match_to_option": false,
"is_color": false,
"color": "#3557c4",
"position": 1,
"items": [
"6543210fedcba98765432101"
],
"thumbnail": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100"
}Persist a new display order for a set of collections. Send items: [{ _id, position }]. 400 "No items" for an empty list. Answers 200.
Needs a site admin token.
The collection's items.
curl -X PATCH 'http://bulgariandebateassociation.max-media.io/collections-reorder?ionic=true' \
-H 'Authorization: Bearer <TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "items": "..." }'One category, with the grouping filters inside it. With the grouping filters that sit in it or in no category. 404 when there is no such category.
Public - no token needed.
The ID of the collection.
Returns the Collection object.
curl -X GET 'http://bulgariandebateassociation.max-media.io/collections/{id}?ionic=true'{
"name": "Example",
"parent_collection": "6543210fedcba98765432100",
"picture": "6543210fedcba98765432100",
"about_page": "6543210fedcba98765432100",
"match_to_option": false,
"is_color": false,
"color": "#3557c4",
"position": 1,
"items": [
"6543210fedcba98765432101"
],
"thumbnail": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100"
}Updates a category. Fields outside the allowed list are ignored. A rename also renames the navigation entry that links to it. Answers the category, or 404.
Needs a site admin token.
The ID of the collection.
Returns the Collection object.
curl -X PATCH 'http://bulgariandebateassociation.max-media.io/collections/{id}?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'{
"name": "Example",
"parent_collection": "6543210fedcba98765432100",
"picture": "6543210fedcba98765432100",
"about_page": "6543210fedcba98765432100",
"match_to_option": false,
"is_color": false,
"color": "#3557c4",
"position": 1,
"items": [
"6543210fedcba98765432101"
],
"thumbnail": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100"
}Deletes a category. Answers the deleted category. Items in it keep its id as collection_id, and a navigation entry linking to it stays: remove those separately.
Needs a site admin token.
The ID of the collection.
Returns an empty answer on success.
curl -X DELETE 'http://bulgariandebateassociation.max-media.io/collections/{id}?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'A category's picture. Answers the picture's media id, or 404.
Public - no token needed.
The ID of the collection.
Returns the Collection object.
curl -X GET 'http://bulgariandebateassociation.max-media.io/collections/{id}/media?ionic=true'{
"name": "Example",
"parent_collection": "6543210fedcba98765432100",
"picture": "6543210fedcba98765432100",
"about_page": "6543210fedcba98765432100",
"match_to_option": false,
"is_color": false,
"color": "#3557c4",
"position": 1,
"items": [
"6543210fedcba98765432101"
],
"thumbnail": "6543210fedcba98765432100",
"_id": "6543210fedcba98765432100"
}Uploads a category's picture (media, form field). Multipart upload; becomes the category's picture.
Needs a site admin token.
The ID of the collection.
curl -X POST 'http://bulgariandebateassociation.max-media.io/collections/{id}/media?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'Removes a category's picture. Deletes the media record too.
Needs a site admin token.
The ID of the collection.
Returns an empty answer on success.
curl -X DELETE 'http://bulgariandebateassociation.max-media.io/collections/{id}/media?ionic=true' \
-H 'Authorization: Bearer <TOKEN>'