Unicat API Reference

Up - API Reference - Home


data assets

An asset is an uploaded file or image, or a folder. Assets are stored in a hierarchical way, a tree-structure. We extract information for each asset, which is returned as a dictionary that uses the global identifier (gid) as a key.

To get the actual asset (or a transformation of it, such as a thumbnail), we use the DAM API.

asset data for a folder

{
    ,
    "data": {
        "assets": {
            "5e78c224-a308-4ea7-b283-9b39ffb09aa2": {
                "gid": "5e78c224-a308-4ea7-b283-9b39ffb09aa2",
                "pathname": "/barcodes",
                "is_file": false,
                "type": null,
                "childcount": 7,
                "status": "published",
                "info": {
                    "filecount": 6,
                    "foldercount": 1
                },
                "transforms": null,
                "path": "/",
                "name": "barcodes",
                "title": {
                    "nl": "",
                    "en": ""
                },
                "description": {
                    "nl": "",
                    "en": ""
                },
                "updated_on": 1610635126.04762
            }
        }
    }
}

asset data for a file

{
    ,
    "data": {
        "assets": {
            "218437b3-f3db-4f60-9d44-c96319aa3c57": {
                "gid": "218437b3-f3db-4f60-9d44-c96319aa3c57",
                "pathname": "/image.svg",
                "is_file": true,
                "type": "svg",
                "childcount": 0,
                "status": "published",
                "info": {
                    "pages": 1,
                    "width": 333,
                    "colors": "truecolormatte",
                    "format": "svg",
                    "height": 333,
                    "animated": false,
                    "filesize": 1192,
                    "metadata": {
                        "date:create": "2021-01-14T15:38:43+01:00",
                        "date:modify": "2021-01-14T15:38:43+01:00"
                    },
                    "colorspace": "srgb",
                    "resolution": [
                        300,
                        300
                    ],
                    "transparent": true
                },
                "transforms": {
                    "_main_": {
                        "crop": null,
                        "hotspot": [
                            0.6467065868263473,
                            0.40119760479041916
                        ]
                    }
                },
                "path": "/",
                "name": "image.svg",
                "title": {
                    "nl": "Een generiek afbeelding icoon",
                    "en": "A generic image icon"
                },
                "description": {
                    "nl": "Afbeelding icoon - een lijntekening van een lijst met daarin bergen en de zon.",
                    "en": "Image icon - a line drawing of a frame containing mountains and the sun."
                },
                "updated_on": 1610635123.351925
            }
        }
    }
}

Asset properties

gid global identifier
pathname the full path to the asset
path the full path to the folder the asset is in
name the name of the asset - combined with the path it yields the pathname
is_file is true for files, false for folders
type file type, e.g. svg
childcount for folders, how many assets (both files and folders) are in this folder
status an asset can be published or deleted (prior to being actually, permanently deleted)
info a collection of additional values depending on type, described below
transforms files and images can have transformations like hotspots, crops, resizes - for now we only store one _main_ transform
title localized title for the asset, useful as the title attribute in html
description localized title for the asset, useful as the alt attribute in html
updated_on timestamp indicating the last time the asset info was updated

info for a folder

filecount the number of files in this folder - combined with foldercount it will give childcount
foldercount the number of subfolders in this folder - combined with filecount it will give childcount

info for a file

pages for PDFs the number of pages, for animated GIFs the number of frames
width in pixels
height in pixels
colors is this a truecolor or greyscale or other image
format file type, e.g. svg
animated is true for animated images, false otherwise
filesize file size in bytes
metadata a dictionary containing additional info that is included in the file
colorspace the color space for the image
resolution the [x, y] resolution for the image, in dpi
transparent is true for images with transparency enabled, false otherwise