logo
logo

Public links

On the Asset details page of Sitecore Content Hub™, you can make renditions public. Public means that, unlike all the other files, the file is accessible under a URL that is not pre-signed. Anyone who knows the static URL can cache and fetch the file.

To make a rendition public, you need to enter the following information:

  • The rendition name.
  • The path under which the rendition is available to the public, for example, myasset/mypath (optional).
  • An expiration date (optional).

When you save this information, the request is processed, and the link is made available.

The expiration system

You can configure the link to expire after a certain amount of time. If you do not set an expiration date and time, then the file never expires.

However, as the link's content can be cached, it can still be accessible after the expiration for a maximum of 24 hours.

The same happens if you delete a link. If cached, the link remains available for a maximum of 24 hours.

Resource types

Every public link is automatically associated with a resource type. This association allows the public endpoint to be configured to serve only two types of resources for more flexibility:

  • content: for links generated by users.
  • portal: for links generated by the system.

Force download

By default, a public link file is displayed in the browser if it is possible. However, you cannot display some file types like zip files in the browser. These file types are automatically downloaded.

If you want public links to download automatically, you need to set the download query parameter to true.

For example:

https://mysite/api/public/content/b2f7bfc7756b4e8891dd9ec54453024a?v=7dbfe11b&download=true

Transformations

You can apply conversions on public link images dynamically by using transformations.

Transformations are entities representing a conversion configuration for the public links; this means that, once a transformation entity has been created, you can directly apply it on all public links without any need for regeneration.

Transformations are identified by a name. You can use the name in a public link's URL to tell the API that a transformation is required for this public link.

For example, in the following link, https://MyMediaDelivery/api/public/content/myPublicLink?t=myTransformation the part t=mytransformation informs the public link API that we want to apply a transformation called myTransformation when serving the file.

You can configure transformations from the Transformations page under the Manage menu. For each of them, you can configure:

  • Name
  • Width
  • Height
  • Quality
Note

The transformed file is always in jpeg format.

Image merging

You can merge multiple public link images into one using public links image merging. To use the public links image merging, add the b parameter to the public link URL.

For example, in the following link http://MyMediaDelivery/api/public/content/myPublicLink?b=mySecondPublicLink,myThirdPublicLink, the b=mySecondPublicLink,myThirdPublicLink parameter requests merging the original public link (the background image) with 2 additional public links:

  • mySecondPublicLink
  • myThirdPublicLink

mySecondPublicLink and myThirdPublicLink are the relative URLs of the public links.

The b parameter is a comma-separated list of public links relative URLs.

Important

You can merge up to five public links into the original one.

Note

If you configure a conversion on a public link, the public link loses transparency because it is converted to a jpeg file. You must ensure the public links you want to use for merging are transparent.

Conversion cache

The public links API caches conversions to avoid overloading the servers when too many conversion requests come in. Caching means storing the converted file in a temporary file provider.

Can we improve this article ? Provide feedback