Swagger Swagger UI
Endpoint
POST
External/Internal
https://{domain}/api/dam/v4/assets/{assetId}/transcodings/dynamic/generate-url
Description of the fields
domain
Mandatory
Papirfly domain or if customer has custom domain configured
Text
assetId
Mandatory
Id of the asset that will be transcoded to different format
Number
-
Must be an image in format
JPEG
JPG
PNG
WebP
SVG
GIF
Headers:
Athorization
Bearer token
-
How to get this token:
-
One of these privileges is needed to asset this endpoint:
Login to PLACE
View Dam Content
Request Body:
{ "fileFormat": "png", "width": 1920, "height": 1080, "colorProfile": "RGB", "crop": { "left": 120, "top": 120, "width": 1920, "height": 1080 }, "forceDownload": true }
Description of the fields
fileFormat
Optional
Output format of transcoded asset
Text
-
Output images can be in format
JPEG
JPG
PNG
WebP
GIF
AVIF
TIFF
TIF
Default value set by API is WebP
width
Optional
Width of output image
Number
height
Optional
Height of output image
Number
colorProfile
Optional
Color profile of output image
Text
-
Values
RGB
sRGB
CMYK
Grayscale
crop
Optional
Crop original image
If crop is present, all parameters must be
-
Parameters
-
left
Number
Position from the left side of image to top left corner of the cropped image
-
top
Number
Position from the top side of image to top left corner of the cropped image
-
width
Number
Width of cropped part of original image
-
heigt
Number
Height of cropped part of original image
-
forceDownload
Optional
Set Header
Content-Dispositionto attachment or inline based on valueBoolean
Default value in APS - false
-
Values
-
true
Set
Content-Dispositionheader to response with valueattachmentUse for downloading transcoded asset
-
false
Set
Content-Dispositionheader to response with valueinlineUse for displaying transcoded asset on website/html element
-
Response Body:
{ "url": "https://(domain)/api/aps/dynamic/123412341234=?f=png&w=10920&h=1080&cp=RGBcr=120,120,1920,1080&d=true" }
{ "url": "https://(domain)/api/aps/dynamic/(endcoded-hash)?f={fileFormat}&w={width}&h={height}&cp={colorProfile}cr={left,top,width,height}&d={forceDownload}" }
API will return url to our APS (Asset Provider Service)
Parameters in () encoded-hash in response url are generated by API. Parameters in {} in response url are taken from request body and can be changed manually without calling the API.
encoded-hash
Text
Can only be generated by API
Encoded and ecrypted combination of portalId, archiveId and assetId parameters from request body
Used to give identifying parameters to fetch Asset in encrypted way, because the url can be used publicly without any authorization
domain
Text
API will use default domain that is configured for customer.
Can be Papirfly domain or customer domains depending on configuration.
Description of flow
-
Call Dam API with requested trancoded asset parameters
User must be authenticated to make this request
Dam API will return response with url to APS - (asset is not transcoded at this stage)
-
Use returned URL to call and fetch transcoded asset
This URL is publicly available without any need of authorization
-
This URL can be used (depends on forceDownload parameter)
to trigger download of transcoded asset
to be inserted to website and let the transcoded asset be displayed there
Comments
0 comments
Please sign in to leave a comment.