Guides

Content Links

Use this API to retrieve links for Asset original content file and asset conversions. You can use this API to get a content link that can be presented as a downloadable link in a web page or an app.

📘

For displaying images and videos, instead of /get_link API, we suggest you use the On-demand Image Transformations and Video Streaming delivered by FileSpin CDN.

REQUEST PARAMETERS

ParameterTypeDescription
ASSET_IDstringAsset ID, 32 character alphanumeric UUID
CONTENT_KEYstringoriginal or any pre-defined conversion name/key for images and video transcodes. See your Settings for image and video keys.
EXPIRYintegerSeconds after which the link should expire. Defaults to 6000 (10 minutes). Use the special value MAX to set expiry to maximum possible (defined as 19 January 2038)
ACCESS_IDstringAccess Id that must be used to sign URLs. You can obtain your account's Access Id from the Authorization Settings page.
DELIVERY_MODEstringOptional parameter to get a link for use in display or download. Values can be display or download. Defaults to download which gets a link that when clicked will download the file.
LINK_TYPEstringoptional parameter to get CDN link or direct storage link. Values can be cdn or object_storage. Defaults to cdn.

Note

  • Set link_type=cdn when you need a link that should be served via FileSpin CDN that should be cached at the edge locations. The use case is usually for distributing files to users across the globe more than once. FileSpin pre-fetches these links for quick delivery. There may be few seconds delay before the file is cached at the edge location.
  • Set link_type=object_storage when you need a link that should be served directly from the Object Storage. The use case is usually for accessing the file only once.
  • For cdn link type, MAX expiry is 19 January 2038.
  • For object_storage link type, MAX expiry is 7 days (604800 seconds).
  • For POST request, the maximum number of assets ids that can be sent is 100

REQUEST BODY PARAMS (POST REQUEST)

Pass the Asset IDs in the request body as a list.

{
  ["c5651f8783f64d09985f0dd38359d846", "aa2e7cce8a1e479daf5eb94cc413e8cb"]
}

HTTP RESPONSE

Response for a single asset GET request

https://cdn.filespin.io/api/v1/files/content/c5651f8783f64d09985f0dd38359d846?key=thumbnail&expiry=1486556379&delivery=display&accessId=IZJTAMBQGAYDAMBQGAYDAMBQGAYDANKT&signature=ScdZeFTEs41edgmfgk-XJbO2ACk%3D

HTTP Status code and JSON response like the one shown in the code sample below.

  • For GET request for a single Asset, the link is returned in response as shown in the code samples to the right.

  • For POST request with multiple Asset IDs, a JSON with links is returned as shown.

{
  "ASSET_ID": "https://URL",
}

Response JSON with links for multiple assets POST request

{
  "c5651f8783f64d09985f0dd38359d846": "https://cdn.filespin.io/api/v1/files/content/c5651f8783f64d09985f0dd38359d846?key=thumbnail&expiry=1486556379&delivery=display&accessId=IZJTAMBQGAYDAMBQGAYDAMBQGAYDANKT&signature=ScdZeFTEs41edgmfgk-XJbO2ACk%3D",
  "aa2e7cce8a1e479daf5eb94cc413e8cb": "https://cdn.filespin.io/api/v1/files/content/ca2e7cce8a1e479daf5eb94cc413e8cb?key=thumbnail&expiry=1486556379&delivery=display&accessId=IZJTAMBQGAYDAMBQGAYDAMBQGAYDANKT&signature=ScdZeFTEs41edgmfgk-XJbO2ACk%3D"
}