Assets

Assets are actually multi-part elements:

The properties and metadata of the asset

Multiple renditions such as the original rendition (which is the originally uploaded asset), a thumbnail and various other renditions. Additional renditions may be images of different sizes, different video encodings, or extracted pages from PDF or InDesign.

Optional comments

Folders have the following components:

Entities

The children of Assets are its renditions.

Properties

Links

Available features

The Assets HTTP API includes the following features:

Retrieve a folder listing

Create a folder

Create an asset

Update asset binary

Update asset metadata

Create an asset rendition

Update an asset rendition

Create an asset comment

Copy a folder or asset

Move a folder or asset

Delete a folder, asset, or rendition

註解：

For the ease of readability the following examples omit the full cURL notation. In fact the notation does correlate with Resty which is a script wrapper for cURL.

Prerequisites

Go to http://<Server>:<Port>/system/console/configMgr.

Navigate to Adobe Granite CSRF Filter.

Make sure the property Filter Methods incudes: POST, PUT, DELETE.

Retrieve a Folder Listing

Retrieves a Siren representation of an existing folder and of its child entities (subfolders or assets).

Properties of contained entities are a subset of the full set of properties of each entity. In order to obtain a full representation of the entity, clients should retrieve the contents of the URL pointed to by the link with a rel of self.

Create a Folder

Creates a new sling:OrderedFolder at the given path. If a * is given instead of a node name the servlet will use the parameter name as node name. Accepted as request data is either a Siren representation of the new folder or a set of name-value pairs, encoded as application/www-form-urlencoded or multipart/form-data, useful for creating a folder directly from an HTML form. Additionally, properties of the folder can be specified as URL query parameters.

The operation will fail with a 500 response code if the parent node of the given path does not exist. If the folder already exists a 409 response code is returned.

200 - OK - if Asset has been updated successfully
404 - NOT FOUND - if Asset could not be found or accessed at the provided URI
412 - PRECONDITION FAILED - if root collection cannot be found or accessed
500 - INTERNAL SERVER ERROR - if something else goes wrong

Update Asset metadata

200 - OK - if Asset has been updated successfully
404 - NOT FOUND - if Asset could not be found or accessed at the provided URI
412 - PRECONDITION FAILED - if root collection cannot be found or accessed
500 - INTERNAL SERVER ERROR - if something else goes wrong

Create an Asset Rendition

Creates a new asset rendition for an asset. If request parameter name is not provided the file name is used as rendition name.

201 - CREATED - if Rendition has been created successfully
404 - NOT FOUND - if Asset could not be found or accessed at the provided URI
412 - PRECONDITION FAILED - if root collection cannot be found or accessed
500 - INTERNAL SERVER ERROR - if something else goes wrong

Update an Asset Rendition

Updates respectively replaces an asset rendition with the new binary data.

200 - OK - if Rendition has been updated successfully
404 - NOT FOUND - if Asset could not be found or accessed at the provided URI
412 - PRECONDITION FAILED - if root collection cannot be found or accessed
500 - INTERNAL SERVER ERROR - if something else goes wrong

201 - CREATED - if Comment has been created successfully
404 - NOT FOUND - if Asset could not be found or accessed at the provided URI
412 - PRECONDITION FAILED - if root collection cannot be found or accessed
500 - INTERNAL SERVER ERROR - if something else goes wrong

Copy a Folder or Asset

Copies a folder or asset at the given path to a new destination.

Request Headers

X-Destination - a new destination URI within the API solution scope to copy the resource to
X-Depth - either 'infinity' or '0'. The value '0' only copies the resource and its properties, no children.
X-Overwrite - 'F' to prevent overwriting an existing destination

201 - CREATED - if folder/asset has been copied to a non-existing destination
204 - NO CONTENT - if the folder/asset has been copied to an existing destination
412 - PRECONDITION FAILED - if a request header is missing or
500 - INTERNAL SERVER ERROR - if something else goes wrong

Move a Folder or Asset

Moves a folder or asset at the given path to a new destination.

Request Headers

X-Destination - a new destination URI within the API solution scope to copy the resource to
X-Depth - either 'infinity' or '0'. The value '0' only copies the resource and its properties, no children.
X-Overwrite - either 'T' to force deletion of existing resources or 'F' to prevent overwriting an existing resource.

201 - CREATED - if folder/asset has been copied to a non-existing destination
204 - NO CONTENT - if the folder/asset has been copied to an existing destination
412 - PRECONDITION FAILED - if a request header is missing or
500 - INTERNAL SERVER ERROR - if something else goes wrong