Asset

View as Markdown

Asset

Asset class to fetch file details on Conentstack server.



NameTypeDescription
uid String

Contentstack Asset UID for this asset

filename String

Name of the asset.

url String

URL to fetch/render the asset

content_type String

Content Type for the asset. image/png, image/jpeg, application/pdf, video/mp4 etc.

filesize String

Size of the asset.

tags Array

Array of tags assigned to the asset.

fetch

Fetch a particular asset using uid.

require "contentstack";


@stack = Contentstack::Client.new("api_key", "delivery_token", "environment");

@asset = @stack.asset("asset_uid").fetch;