Fetching multiple assets

Fetching assets

Prepr stores all your digital assets in the Media Library (in Prepr: the Media tab), making it easy to access, view, and manage your assets. You can add, edit, download, or delete files whenever needed; categorize, search, and filter assets on multiple attributes to find the right one quickly.

GET: /assets

Search

Prepr assets can be searched on their title or text fields.

GET: /assets?q[0][fz]=Beach Club

Types

Assets can be filtered on their type. Available options are: Photo, Video, Audio, Document.

GET: /assets?labels[0][eq]=Video

Tags

Assets can be filtered on their tags. You can query the tag fields by using the tags argument.

In this example we will query all the assets with the tag
`222b7528-9e3a-294f-21bf-7ec623d1ac74` **or** `bcc9eea7-7307-f45b-5aaf-27eca7d329f9`.
 
GET: /assets?tags[0][in][0]=222b7528-9e3a-294f-21bf-7ec623d1ac74&tags[0][in][1]=bcc9eea7-7307-f45b-5aaf-27eca7d329f9

Content Item relation

Assets can be filtered on their relation to content items.

In this example, we will query all the assets used in content items.
 
GET: /assets?content_item[0][has]=true

Collections

Assets can be filtered on their relation to collections. You can query the collections fields by using the collections argument.

GET: /assets?collections[0][eq]={ID}

Query by Reference ID

The Reference ID is useful for storing external asset Ids. For example, during the migration of assets from another system. Check out the Migration doc for more details. Here is an example that demonstrates how to query an asset with a Reference ID value.

GET: /assets?reference_id[0][eq]=123456

Sorting

You can use the sort argument to order your query results in a particular order.

{
    "sort": "created_on"
}

Sort by metadata fields

It is possible to sort by the assets created, changed dates in either ascending or descending order.

The current values for sorting those fields are created_on, -created_on, changed_on, -changed_on.

Default ordering

If you don't pass an explicit order value the returned assets will be ordered descending by asset changed on timestamp -changed_on. This means that the most recently changed asset will appear at the top of the list.

Was this article helpful?

We’d love to learn from your feedback