AssetQuery

View as Markdown

AssetQuery

The AssetQuery provides query on assets

includeBranch

Included branch in the response.

import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..includeBranch();

version

Specify the version number of the asset that you wish to retrieve.

import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..version(3);

relativeUrls

includes the relative URLs of the assets in the response

import contentstack
final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..relativeUrls();

includeFallback

Retrieve the published content of the fallback locale if an entry is not localized in specified locale.

import contentstack

final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');
final asset = stack.assetQuery()..includeFallback();

includeDimension

include the dimensions (height and width) of the image in the response.

import contentstack

final var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..includeCount();

includeCount

To retrieve the count of entries.

import contentstack
var stack = contentstack.Stack('apiKey', 'deliveryToken', 'environment');final asset = stack.assetQuery()..includeCount();

environment

Enter the name of the [environment] if you wish to retrieve the assets published in a particular environment.

NameTypeDescription
environment (required)String

The Environment

import Contentstack


final stack = final contentType = stack.contentType(“content_type_uid”);

final asset = stack.assetQuery()..environment();