sams.api.consume – Consumption API

sams.api.consume.sets – Sets

The Sets Consume API allows to search Sets.

This service and resource is intended to be used by external clients. To access Sets inside the SAMS application, use the sams.sets module instead

endpoint name

‘consume_sets’

resource title

‘Set’

resource url

[GET] ‘/consume/sets’

item url

[GET] ‘/consume/sets/<ObjectId>’

schema

sams_client.schemas.sets.SET_SCHEMA

sams.api.consume.assets – Assets

The Assets Consume API allows to search Assets.

This service and resource is intended to be used by external clients. To access Assets inside the SAMS application, use the sams.assets module instead

Endpoint Attributes

endpoint name

‘consume_assets’

resource title

‘Asset’

resource url

[GET] ‘/consume/assets’

item url

[GET] ‘/consume/assets/<ObjectId>’

schema

sams_client.schemas.assets.IAsset

HATEOAS:

The following is a list of extra HATEOAS entries for each Asset returned.

Entry

Title

Href

public

Public Asset

Full url to download the file using the SAMS FileServer

Download Asset Binary

endpoint name

‘download_asset_binary’

resource title

‘Download Asset’

item url

[GET] ‘/consume/assets/binary/<ObjectId>’

Download Asset Image Rendition

endpoint name

‘download_asset_image_rendition’

resource title

‘Download Asset Image Rendition’

item url

[GET] ‘/consume/assets/images/<ObjectId>’

url args

  • str: width [optional]

  • str: height [optional]

  • bool: keep_proportions [optional]

Download Multiple Asset Binaries

endpoint name

‘download_assets_binary’

resource title

‘Download Multiple Assets’

item url

[GET] ‘/consume/assets/compressed_binary/<list`[:class:`~bson.objectid.ObjectId]>’

Example Responses

Single Asset:

curl http://localhost:5700/consume/assets/5f97aea1cb0c490147038936
{
    "_id": "5f97aea1cb0c490147038936",,
    "_created": "2020-10-27T05:22:41+0000",
    "_updated": "2020-10-27T05:22:41+0000",
    "_etag": "169baf88f70e8233a3e588894bfff379f7dbb0e9",
    "name": "bbb 0004",
    "description": "Big Buck Bunny - Frame 0004",
    "filename": "bbb_0004.png",
    "mimetype": "image/png",
    "length": 18716701,
    "state": "public",
    "set_id": "5f86b3f8cf6caa95368d074e",
    "_links": {
        "self": {
            "title": "Asset",
            "href": "consume/assets/5f97aea1cb0c490147038936"
        },
        "parent": {
            "title": "home",
            "href": "/"
        },
        "collection": {
            "title": "Asset",
            "href": "consume/assets"
        },
        "public": {
            "title": "Public Asset",
            "href": "http://localhost:5750/assets/5f86b3f8cf6caa95368d074e/5f97aea1cb0c490147038936"
        }
    }
}

Multiple Assets:

curl http://localhost:5700/consume/assets
{
    "_items": [{
        "_id": "5f97aea1cb0c490147038936",,
        "_created": "2020-10-27T05:22:41+0000",
        "_updated": "2020-10-27T05:22:41+0000",
        "_etag": "169baf88f70e8233a3e588894bfff379f7dbb0e9",
        "name": "bbb 0004",
        "description": "Big Buck Bunny - Frame 0004",
        "filename": "bbb_0004.png",
        "mimetype": "image/png",
        "length": 18716701,
        "state": "public",
        "set_id": "5f86b3f8cf6caa95368d074e",
        "_links": {
            "self": {
                "title": "Asset",
                "href": "consume/assets/5f97aea1cb0c490147038936"
            },
            "public": {
                "title": "Public Asset",
                "href": "http://localhost:5750/assets/5f86b3f8cf6caa95368d074e/5f97aea1cb0c490147038936"
            }
        }
    }, {
        "_id": "5f976757663e191130679f8a",
        "_created": "2020-10-27T00:18:31+0000",
        "_updated": "2020-10-27T00:18:31+0000",
        "_etag": "5680e57ddcdf1cf088c8f9ecf3ae0b57850cc288",
        "name": "bbb_0001.png",
        "description": "",
        "filename": "bbb_0001.png",
        "mimetype": "image/png",
        "length": 26413745,
        "state": "draft",
        "set_id": "5f86b3f8cf6caa95368d074e",
        "_links": {
            "self": {
                "title": "Asset",
                "href": "consume/assets/5f976757663e191130679f8a"
            }
        }
    }],
    "_links": {
        "parent": {
            "title": "home",
            "href": "/"
        },
        "self": {
            "title": "Asset",
            "href": "consume/assets"
        }
    },
    "_meta": {
        "page": 1,
        "max_results": 25,
        "total": 2
    }
}