Prepr Documentation

Welcome to the Prepr Documentation. You'll find comprehensive guides and documentation to help you start working with Prepr as quickly as possible, as well as support if you get stuck. Let's jump right in!

Get Started    

Resizing images with CloudFront


The Images API is a read-only API for delivering images to apps, websites and other touch points.

The Images API is available via a globally (by default Europe/US/Canada) distributed content delivery network (CDN) powered by Amazon CloudFront services. The server closest to the user serves all content, which minimizes latency and especially benefits mobile apps. Hosting content in multiple global data centers also improves the availability of content.

You can request images in in specific sizes and crops.

Images are returned with a source_file field. This object returns a cdn_url param that you can use as a basis for resizing the image needed for your app.

The url contains a part that is returned as {format} you need to replace this with the desired format.
Options are width (w), height (h), quality (q) and crop (c).

Crop options: (default: centre)
north, northeast, east, southeast, south, southwest, west, northwest, center, centre

The format is constructed as {option}_{value} so if we would wanted to get the image in a 200px width form, {format} would be replaced with w_200.

To simplify this it's possible to let the API construct those urls for you. Just add them as an extra field in the cdn_files field. For example:


// Particle response of /assets endpoint.
	"cdn_files": {
		"total": 1,
		"items": [{
			"id": "0e10b16-a403-41c1-bb2d-b13b1715585",
			"created_on": "2018-04-17T19:45:53+00:00",
			"changed_on": null,
			"label": "SourceFile",
			"original_name": "74658732548727647823678.jpg",
			"mime_type": "image/jpeg",
			"file_size": 10157,
			"file": "",
			"cdn_url": "{format}/example/0e10b16-a403-41c1-bb2d-b13b1715585.jpg",
			"resized": {
				"landing": ",h_232/example/0e10b16-a403-41c1-bb2d-b13b1715585.jpg"

This will add an extra param to the object with the pre-rendered url. It is possible to add up to 3 different formats into the request.

Nested fields

To read more about nested fields for the publications endpoint or assets endpoint.


Try it yourself

Updated 24 days ago

Resizing images with CloudFront

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.