Skip to main content

Sets

Return an individual image from a set, including images nested inside another set, or return the set's metadata in one of five formats. Sets also support the same SEO-friendly URL paths as single images.

Base URL pattern

The parameters on this page are appended to a Dynamic Media image URL. For the URL pattern and how parameters chain together, see the Media Delivery API guide.

Sets are named groupings of assets. The Set API allows you to retrieve individual elements or full metadata from a set.

Retrieving set images
Link copied!

Return first element
Link copied!

GET /s/{account}/{setName}
GET /s/{account}/{setName}?{params}
GET /s/{account}/{setName}/seoFilename

Returns the first element of the set as an image. For video sets, the thumbnail is returned. Standard image transformation parameters can be applied.

https://cdn.media.amplience.net/s/ampproduct/mytestset?w=400
Try it...
400

Return nth element
Link copied!

GET /s/{account}/{setName}/{n}
GET /s/{account}/{setName}/{n}?{params}

Returns the nth element of the set as an image. Indexing starts at 1.

The element index is part of the URL path - edit it directly in the URL bar below to step through the set:

https://cdn.media.amplience.net/s/ampproduct/mytestset/3?w=400
Try it...
400

Return nested nth element
Link copied!

GET /s/{account}/{setName}/{n}/{n}

Returns the nth element from within a nested set.

Set metadata
Link copied!

Returns the contents of a set in the requested format.

Common query parameters for all metadata formats:

ParameterDescription
qualWhether URLs in the response are fully qualified. Default: true
qryQuery string appended to all set element URLs. Supports transformation template names.
deepWhether nested set structure is included in the response. Default: false

JSONP format
Link copied!

GET /s/{account}/{setName}.js

Returns set data as JSON wrapped in a JSONP callback.

Additional parameters:

ParameterDescription
funcName of the JSONP callback function
argOptional argument passed to the callback function

Example
Link copied!

https://cdn.media.amplience.net/s/ampproduct/mytestset.js?qry=$exampletemplate$

JSON format
Link copied!

GET /s/{account}/{setName}.json

Returns set data as JSON.

Example
Link copied!

https://cdn.media.amplience.net/s/ampproduct/mytestset.json

XML format
Link copied!

GET /s/{account}/{setName}.xml

Returns set data as XML.

Example
Link copied!

https://cdn.media.amplience.net/s/ampproduct/mytestset.xml

Text format
Link copied!

GET /s/{account}/{setName}.txt

Returns set element URLs in plain text.

Example
Link copied!

https://cdn.media.amplience.net/s/ampproduct/mytestset.txt

HTML format
Link copied!

GET /s/{account}/{setName}.html

Returns set elements as an HTML <ul> list with each element in a <li> tag.

Additional parameters:

ParameterDescription
ulClsCSS class applied to <ul> tags
liClsCSS class applied to <li> tags
sizeWhen true, adds original width and height attributes to <img> tags

Example
Link copied!

https://cdn.media.amplience.net/s/ampproduct/mytestset.html?size=true

SEO and sets
Link copied!

Info

When adding SEO text to a set URL, avoid starting the SEO segment with a number - Dynamic Media will interpret it as a set index. Prefix with a non-numeric character to avoid this.

The following example results in an error because the Media Delivery API interprets "3" as the set index.

https://cdn.media.amplience.net/s/ampproduct/spring-collection-set/3-red-dress/womens/spring

Prefix the SEO segment with an underscore so that the URL is interpreted correctly.

https://cdn.media.amplience.net/s/ampproduct/spring-collection-set/_3-red-dress/womens/spring

SEO
Link copied!

The SEO text is included in the request path but does not affect the image returned.

Examples
Link copied!

Base URL using a product code
Link copied!

https://cdn.media.amplience.net/i/ampproduct/1377455-collection-spring

With SEO path appended
Link copied!

https://cdn.media.amplience.net/i/ampproduct/1377455-collection-spring/womens/spring/red-dress