Contentful SDK v0.3.2 Contentful.Delivery.Assets View Source
Deals with the loading of assets from a given Contentful.Space
See https://www.contentful.com/developers/docs/references/content-delivery-api/#/reference/assets.end
Simple asset calls
A Contentful.Asset
can be retrieved by its asset_id
:
import Contentful.Query alias Contentful.Asset alias Contentful.Delivery.Assets
} = Assets |> fetch_one("my_asset_id")
or just as a collection:
import Contentful.Query alias Contentful.Asset alias Contentful.Delivery.Assets
| _ ]} = Assets |> fetch_all
Resolving assets from entries
In the case of inclusion of assets with entries, see the docs for Contentful.Entries
to see how to resolve assets
from entries.
Accessing common resource attributes
A Contentful.Asset
embeds Contentful.SysData
with extra information about the entry:
import Contentful.Query alias Contentful.Asset alias Contentful.Delivery.Assets
= Assets |> fetch_one("my_asset_id")
"my_asset_id" = asset.id "<a timestamp for updated_at>" = asset.sys.updated_at "<a timestamp for created_at>" = asset.sys.created_at "<a locale string>" = asset.sys.locale
Link to this section Summary
Functions
Returns the endpoint for assets
Link to this section Functions
Returns the endpoint for assets