Collection - OgnianApostolov/builderly-api-docs GitHub Wiki

Model

Collection collection {
    "_id": {
        "autogenerated": "true"
    },
    "name": {
        "type": "string",
        "unique": "true",
        "required": "true"
    },
    "parent_collection": {
        "ref": "Collection._ObjectId"
    },
    "picture": {
        "ref": "Media._ObjectId"
    },
    "about_page": {
        "ref": "AboutPage._ObjectId"
    },
    "items": [{
        "type": "Items._ObjectId"
    }]
}

Methods

Create new

POST /collections req.body required

method: 'POST'
{
    url: 'https://{{your-builderly-domain}}/collections',
    headers: {
        'Authorization': 'Bearer ' + token
    },
    json: true,
    body: collection
}

Responses Success - status 201

{}

Error - status 400

{
    error_message
}

Retrieve multiple

GET /collections

method: 'GET'
{
    url: 'https://{{your-builderly-domain}}/collections',
    headers: {},
    json: true,
    body: {}
}

Responses Success - status 200

[collections]

Error - status 500

{
    error_message
}
  • Example usages: /collections - Get all collection articles

Retrieve single

GET /collections/:id

method: 'GET'
{
    url: 'https://{{your-builderly-domain}}/collections/{{collecltion._id}}',
    headers: {},
    json: true,
    body: collection
}

Responses Success - status 200

{
    collection
}

Not found - status 404

{}

Error - status 500

{
    error_message
}
  • Example usages: /collections/collection._id - Retrieve a specific collection

Update single

PATCH /collections/:id

method: 'PATCH'
{
    url: 'https://{{your-builderly-domain}}/collections/{{collection._id}}',
    headers: {
        'Authorization': 'Bearer ' + token
    },
    json: true,
    body: collection
}

Responses Success - status 200

    { collection }

Error - status 400

{
    error_message
}

Not found - status 404

{}

Delete single

DELETE /collections/:id

method: 'DELETE'
{
    url: 'https://{{your-builderly-domain}}/collections/{{collection._id}}',
    headers: {
        'Authorization': 'Bearer ' + token
    },
    json: true,
    body: {}
}

Responses Success - status 200

{ collection }

Not found - status 404

{}

Error - status 500

{
    error_message
}