Media Library

the entities you upload through the Admin UI or the API, and that you can reference within your Contents.

Media Object

The Media data model is like the following:

{
    "id": "string",
    "code": "string",
    "folder": "string",
    "type": "image|video|document",
    "createdAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "createdBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "modifiedAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "modifiedBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "author": "string",
    "copyright": "string",
    "originalFileName": "string",
    "name": "string",
    "format": "string",
    "hash": "string",
    "mimeType": "string",
    "size": 0,
    "url": "string",
    "height": 0,
    "width": 0,
    "horizontalResolution": 0.0,
    "verticalResolution": 0.0,
    "duration": 0,
    "fps": 0,
    "codec": "string",
    "exif": {},
    "metadata": {
    }
}
Property
Description

id

The Entity ID.

code

The unique code for internal usage.

folder

The path of the folder where the media is stored.

type

can be one of image, video, document.

createdAt

Creation date (UCT).

createdBy

The username of the user who created the Entity.

modifiedAt

Modify date (UTC).

modifiedBy

The username of the user who modified the Entity.

author

The author of the media.

copyright

A copyright text.

originalFileName

The original file name the user uploaded.

name

The file name used internally.

format

The format of the file discovered by the analyzer.

hash

The hash representation of the file.

mimeType

The mime-type

size

The size in bytes

url

The full url of the media

height

The height in pixel (for image and video)

width

The width in pixel (for image and video)

horizontalResolution

The horizontal resolution in dpi (for image)

verticalResolution

The vertical resolution in dpi (for image)

duration

The duration in seconds (for video)

fps

The Frame per Second (for video)

codec

The underneath codec name (for video)

exif

The exif information object the analyzer can extract from images. When available they can be - make = the device brand - model = the device model - orientation = the orientation of the device when the image was taken - flash = the status of the flash when the imagewas taken - exposureTime = the exposure time in seconds when the image was taken - focalLenght= how far the cameras are zoomed in (millimiters) when the image was taken - FNumber= the FNumber of the camera when the image was taken - ISO= the used ISO

metadata

dynamic object to add metadata to the Media

Folder Object

The Folder data model is like the following:

{
    "id": "0",
    "text": "Home",
    "path": "/",
    "children": [
         ...
    ]
}
Property
Description

id

The Entity ID.

text

The folder name.

path

The folder full path

children

Array of folder objects.

Reference

List Media

Return a paged list of media entries

GET /media-library/media

Query Parameters

Name
Type
Description

page

Integer

The page to return default = 1

size

Integer

The number of entries to return

default = 25

filter

String

sort

String

folder

String

The folder full path

searchInSubfolders

Boolean

If true search also in sub-folders

{
    "data": [
	{
		"id": "string",
		"code": "string",
		"folder": "string",
		"type": "image|video|document",
		"createdAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
		"createdBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
		"modifiedAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
		"modifiedBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
		"author": "string",
		"copyright": "string",
		"originalFileName": "string",
		"name": "string",
		"format": "string",
		"hash": "string",
		"mimeType": "string",
		"size": 0,
		"url": "string",
		"height": 0,
		"width": 0,
		"horizontalResolution": 0.0,
		"verticalResolution": 0.0,
		"duration": 0,
		"fps": 0,
		"codec": "string",
		"exif": {},
		"metadata": {
		}
	},
        ....
    ],
    "metadata": {
        "currentPage": 1,
        "pageSize": 25,
        "hasPreviousPage": false,
        "hasNextPage": false,
        "totalPages": 1,
        "count": 1
    }
}

Get Media

Return a media entry by Id

GET /media-library/media/{id}

Path Parameters

Name
Type
Description

id*

String

The Id of the media

{
    "id": "string",
    "code": "string",
    "folder": "string",
    "type": "image|video|document",
    "createdAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "createdBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "modifiedAt": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "modifiedBy": "yyyy-MM-ddTHH:mm:ss.fff+HH:mm",
    "author": "string",
    "copyright": "string",
    "originalFileName": "string",
    "name": "string",
    "format": "string",
    "hash": "string",
    "mimeType": "string",
    "size": 0,
    "url": "string",
    "height": 0,
    "width": 0,
    "horizontalResolution": 0.0,
    "verticalResolution": 0.0,
    "duration": 0,
    "fps": 0,
    "codec": "string",
    "exif": {},
    "metadata": {
    }
}

Delete Media

Delete a media entry by Id

DELETE /media-library/media/{id}

Path Parameters

Name
Type
Description

id*

String

The Id of the media

Move Media

Move a media entry under another folder

POST /media-library/media/move

Request Body

Name
Type
Description

{}

Json object

{
   "result": "folder full path where media has moved"
}
{
    "mediaId": "string",
    "moveTo": "folder full path"
}

List Folders

Return the folders structure

GET /media-library/folders

{
  "id": "string",
  "text": "Home",
  "path": "/",
  "children": [
    {
      "id": "string",
      "text": "folder_name_1",
      "path": "/folder_name_1/",
      "children": [
        {
          "id": "string",
          "text": "folder_name_1_1",
          "path": "/folder_name_1/folder_name_1_1/",
          "children": []
        },
        ...
      ]
    },
    {
      "id": "string",
      "text": "folder_name_2",
      "path": "/folder_name_2/"
    },
    ...
  ]
}

Create Folder

Create a new folder

POST /media-library/folders

Request Body

Name
Type
Description

{}*

Json object

{
  "result": "folder full path"
}

Rename Folder

Rename a folder

POST /media-library/folders/rename

Request Body

Name
Type
Description

{}*

Json object

{
  "result": "folder full path"
}
//Sample payload
{
    "folder": "folder full path",
    "newName" "string"
}

The newName property must contains only the new name for the folder and not a path like name

Move Folder

Move a folder under another folder

POST /media-library/folders/move

Request Body

Name
Type
Description

{}*

Json object

{
  "result": "folder full path"
}
//Sample payload
{
    "folder": "folder full path",
    "moveTo": "folder full path"
}

Delete Folder

Delete a folder

DELETE /media-library/folders

Query Parameters

Name
Type
Description

folder

String

The folder full path

Be careful: When you delete a folder the system delete all sub-folders and files.

Last updated