API ReferenceView as MarkdownOpenAPI

Collections

View as Markdown

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.

10 endpoints.

Retrieve an associated group

Get associated collections to another collection.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the associated group.

Query parameters
topicstring

Only associated groups with this topic.

servicestring

Only associated groups with this service.

donation-topicstring

Only associated groups with this donation topic.

Status codes

200 404 500

GET/associated-groups/:id
curl -X GET 'http://cloudoffice-gr.max-media.io/associated-groups/{id}?ionic=true&topic=...&service=...&donation-topic=...'
Response
{
  "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"
}

List all collections

Returns the site's collections, newest first unless a sort is given.

Public

Public - no token needed.

Query parameters
typestring

Only collections with this type.

Returns

Returns a list of Collection objects.

Status codes

200 500

GET/collections
curl -X GET 'http://cloudoffice-gr.max-media.io/collections?ionic=true&type=...'
Response
[
  {
    "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"
  }
]

Create a collection

Create new collection.

Admin token

Needs a site admin token.

Parameters
createNavstring

The collection's create nav.

Returns

Returns the Collection object.

Status codes

201 400 401 500

POST/collections
curl -X POST 'http://cloudoffice-gr.max-media.io/collections?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "createNav": "..." }'
Response
{
  "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"
}

Reorder collections

Persist a new display order for a set of collections.

Admin token

Needs a site admin token.

Parameters
itemsstring

The collection's items.

Status codes

200 400 401 500

PATCH/collections-reorder
curl -X PATCH 'http://cloudoffice-gr.max-media.io/collections-reorder?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{ "items": "..." }'

Retrieve a collection

Returns one collection, found by its ID.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 404 500

GET/collections/:id
curl -X GET 'http://cloudoffice-gr.max-media.io/collections/{id}?ionic=true'
Response
{
  "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"
}

Update a collection

Update Collection by id.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 400 401 404 500

PATCH/collections/:id
curl -X PATCH 'http://cloudoffice-gr.max-media.io/collections/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
Response
{
  "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"
}

Delete a collection

Delete Collection record by id.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns an empty answer on success.

Status codes

200 401 404 500

DELETE/collections/:id
curl -X DELETE 'http://cloudoffice-gr.max-media.io/collections/{id}?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Retrieve a collection

Returns one collection, found by its ID.

Public

Public - no token needed.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns the Collection object.

Status codes

200 404 500

GET/collections/:id/media
curl -X GET 'http://cloudoffice-gr.max-media.io/collections/{id}/media?ionic=true'
Response
{
  "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"
}

Create a collection

Creates a collection from the fields sent.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Status codes

200 400 401

POST/collections/:id/media
curl -X POST 'http://cloudoffice-gr.max-media.io/collections/{id}/media?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'

Delete a collection

Deletes the collection. This cannot be undone.

Admin token

Needs a site admin token.

Path parameters
idstringRequired

The ID of the collection.

Returns

Returns an empty answer on success.

Status codes

200 401

DELETE/collections/:id/media
curl -X DELETE 'http://cloudoffice-gr.max-media.io/collections/{id}/media?ionic=true' \
  -H 'Authorization: Bearer <TOKEN>'
↑↓ Navigate↵ GoEsc Close