...
(LOWER(subTypeOp) = 'watermark') OR (object.private != 1)
Listing all renditions for a media
There are too many renditions to list in this document, and there is an API you can invoke to list all the variations of a given asset :
...
Code Block | ||
---|---|---|
| ||
curl -X GET "https://club-wed.wedia-group.com:443/api/wedia/dam/variations?object=asset&id=113" -H "accept: */*" |
Using the REST API to get assets and players
Using the REST API, you can query the dam to return a list of media with conditions
Info |
---|
Querying the REST API is detailed in the REST API documentation, for the endpoint /api/rest/dam. This endpoint documentation can be obtained via the URL /api/rest/doc/dam, particularly in the documentation section named Asset Collections, which you can directly access via the URL api/rest/doc/dam?tag=assets. |
To obtain a list of media, simply call /api/rest/dam/asset
, which will return data for all collections.
You can restrict your query to only one collection by using /api/rest/dam/data/<the desired collection>
, or only certain collection by indicating the list of collections separated by commas, i.e., /api/rest/dam/data/<list of collections separated by commas>
.
The response is a JSON where the $.response.data
section lists the different media with:
An identifier (unique per collection) in the id property.
A UUID (unique across the entire solution) in the $uuid property.
You can also obtain the list of existing variations and/or the list of existing players for each media.
In particular, you can get the URLs of the variations and/or players directly, for a specific media, by adding to the end of the URI either the UUID, /api/rest/dam/<uuid>
, or the collection and the identifier, /api/rest/dam/<collection>/<id>
.
To get the list of variation URLs, use the parameter variations=uri
, and for the list of player URLs, use the parameter players=uri
.
If you don’t know which variations and players are available for this asset, you can retrieve the list of variations in the
variations
property and the list of players in theplayers
property. You can only find the variations and players that exist for the media and to which you have access according to the rights of your connected user.
For example:/api/rest/dam/<a uuid>?variations=uri&players=uri
If you know the name of the variation or player that you need, you can add to the previous parameter respectively the parameter
variation=<name of variation>
andplayer=<name of player>
to get only that one if it exists and is accessible to you. If you put several names of variations separated by commas, or of players, the first accessible one will be selected from the list.
For example:/api/rest/dam/<a uuid>?variations=uri&variation=<name of variation>&players=uri&player=<name of player>
The variation URLs you will get are in the format:
/api/rest/dam/data/<collection>/<id>/$variation/<name of variation>
or /api/rest/dam/data/<uuid>/$variation/<name of variation>
for a variation.
/api/rest/dam/data/<collection>/<id>/$player/<name of player>
or /api/rest/dam/data/<uuid>/$player/<name of player>
for a player.
These are aliases for the dedicated endpoints discussed below.
How to build the URL of a Variation or a Player
You can also directly construct the URL of a variation or a player when you know the collection of the media, the identifier of the media, or the UUID of the media.
Variation
For a variation, use the endpoint :
using the collection + id :
/api/wedia/dam/variation/<collection>/<id>/<name of variation (or list of variations separated by commas)>
,
using the uuid :
or /api/wedia/dam/variation/<UUID>/<name of variation (or list of variations separated by commas)>
.
Player
For a player, use the endpoint
/api/wedia/dam/player/<name of player (or list of players)>/<collection>/<id>
DAM API Endpoints
These endpoints are aliases of the two mentioned above. However, they must be accompanied by authentication (bearer or x-wedia-api-token cookie). For use in an HTML link or in the src attribute of an img tag, you must use a cookie.
Using the variation url or the player to display the asset in a website
A variation is a binary file, most often an image. To display it, use the appropriate HTML tags depending on the type:
<img>
for an image.<object>
for a PDF file, for example.<video>
for a video.Or even an
<a>
tag for a link.
with the SRC pointing to the endpoints retrieved above.
You can specify a filename to enable the downloads
For the /api/wedia/dam/variation endpoint, add the name at the end, for example,
/api/wedia/dam/variation/<uuid>/<name of variation>/<filename>
For the /api/rest/dam endpoint, use the filename parameter.
Displaying a Player on a Website
Option 1 : Through the Player API (or the DAM $player endpoint)
The response from the API is directly usable HTML (you can put the URL directly in a browser's address bar).
To display it within an HTML page, use an <iframe
> tag, indicating the URL of the desired player in the src attribute. You can add width and height parameters to indicate a size in CSS values.
Option 2 : Direct Integration of Player Code
You can directly integrate the player code within an <iframe> tag via the endpoint /api/wedia/evp/embed.json
Request Parameters:
Either
object: collection
id: identifier of the object
Or
uuid: UUID of the object in the DAM
playerUid (optional): the MediaCloud player to return, the default player will be used if nothing is specified
width (optional): the width in any CSS unit.
height (optional): the height in any CSS unit.
canLogView (optional): true if analytics hits need to be generated
canLogPlaying (optional): true if interactions with the player's buttons should generate analytics hits
You will receive a JSON with different fields: the code to be directly integrated into the iframe tag is found in the IframeCode field.