preview (latest)

Download OpenAPI specification:

Preview service. 🚀

You can preview the following type of files:

  • images(png/jpeg/gif/svg)
  • pdf
  • documents (xls, xlsx, ods, ppt, pptx, odp, doc, docx, odt)

You will be able to:

  • Preview images.
  • Generate smart thumbnails.

The main difference between thumbnail and preview functionality is that preview tends to be more faithful while thumbnail tends to elaborate on it, cropping it by default and rounding the image if asked. Preview should always output the file in its original format, while thumbnail will convert it to an image. There is no difference in quality between png and jpeg, the difference in quality can be achieved only by asking for a jpeg format and changing the quality parameter. Asking for a GIF output can only be done when the input file is a GIF, otherwise it will raise and error.

image

Get Thumbnail

Creates and returns a thumbnail of the image fetched by id and version with the given size, quality, format and shape. It will automatically crop the picture.

  • id: UUID of the image
  • version: version of the image
  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported.
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
area
required
string (Area)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values

Responses

Response samples

Content type
application/json
null

Post Thumbnail

Creates and returns a thumbnail of the given image with the given size, quality, format and shape.

  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported. This option will lose information, leaving it False will scale and have borders to fill the requested size.
  • file: file uploaded with FormData.
path Parameters
area
required
string (Area)
query Parameters
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Post Preview

Creates and returns a preview of the given image with the given size, quality and format

  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • crop: True will crop the picture starting from the borders. This option will lose information, leaving it False will scale and have borders to fill the requested size.
  • file: file uploaded with FormData.
path Parameters
area
required
string (Area)
query Parameters
crop
boolean (Crop)
Default: false
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Get Preview

Creates and returns a preview of the image fetched by id and version with the given size, quality and format

  • id: UUID of the image
  • version: version of the image
  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • crop: True will crop the picture starting from the borders. This option will lose information, leaving it False will scale and have borders to fill the requested size.
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
area
required
string (Area)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
crop
boolean (Crop)
Default: false
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values

Responses

Response samples

Content type
application/json
null

pdf

Get Preview

Create and returns a preview of the given file, the pdf file will contain the first and last page given. With default values will return all the pages.

  • id: UUID of the pdf.
  • version: version of the pdf.
  • first_page: integer value of first page to preview (n>=1)
  • last_page: integer value of last page to preview (0 = last of the pdf)
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
first_page
integer (First Page)
Default: 1
last_page
integer (Last Page)
Default: 0

Responses

Response samples

Content type
application/json
null

Post Preview

Create and returns a preview of the given file, the pdf file will contain the first and last page given. With default values will return all the pages.

  • file: file uploaded with FormData.
  • first_page: integer value of first page to preview (n>=1)
  • last_page: integer value of last page to preview (0 = last of the pdf)
query Parameters
first_page
integer (First Page)
Default: 1
last_page
integer (Last Page)
Default: 0
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Post Thumbnail

Create and returns the thumbnail of the given file, the image rendered will be the first page.

  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported.
  • file: file uploaded with FormData.
path Parameters
area
required
string (Area)
query Parameters
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Get Thumbnail

Create and returns a thumbnail of the file fetched by id and version the image will be rendered from the first page.

  • id: UUID of the pdf.
  • version: version of the file.
  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported.
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
area
required
string (Area)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values

Responses

Response samples

Content type
application/json
null

document

Get Preview

Create and returns a pdf preview of the given file, the pdf file will contain the first and last page given. With default values will return all the pages.

  • id: UUID of the file.
  • version: version of the file.
  • first_page: integer value of first page to preview (n>=1)
  • last_page: integer value of last page to preview (0 = last of the file)
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
first_page
integer (First Page)
Default: 1
last_page
integer (Last Page)
Default: 0

Responses

Response samples

Content type
application/json
null

Post Preview

Create and returns a pdf preview of the given file, the pdf file will contain the first and last page given. With default values will return all the pages.

  • file: file uploaded with FormData.
  • first_page: integer value of first page to preview (n>=1)
  • last_page: integer value of last page to preview (0 = last of the pdf)
query Parameters
first_page
integer (First Page)
Default: 1
last_page
integer (Last Page)
Default: 0
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Post Thumbnail

Create and returns the thumbnail of the given file, the image rendered will be the first page.

  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported.
  • file: file uploaded with FormData.
path Parameters
area
required
string (Area)
query Parameters
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values
Request Body schema: multipart/form-data
required
file
required
string <binary> (File)

Responses

Response samples

Content type
application/json
null

Get Thumbnail

Create and returns a thumbnail of the file fetched by id and version the image will be rendered from the first page.

  • id: UUID of the file.
  • version: version of the file.
  • quality: quality of the output image (the higher you go the slower the process)
  • output_format: format of the output image
  • area: width of the output image (>=0) x height of the output image (>=0), width x height => 100x200. The first is width, the latter height, the order is important!
  • shape: Rounded and Rectangular are currently supported.
  • service_type: Service that owns the resource (service that first uploaded the data to storage)
path Parameters
id
required
string (Id)
version
required
integer (Version)
area
required
string (Area)
query Parameters
service_type
required
string (ServiceTypeEnum)
Enum: "files" "chats"
Class representing all the service type accepted values
shape
string (ImageBorderShapeEnum)
Default: "rectangular"
Enum: "rounded" "rectangular"
Class representing all the image type accepted values
quality
string (ImageQualityEnum)
Default: "medium"
Enum: "lowest" "low" "medium" "high" "highest"
Class representing all the image quality accepted values
output_format
string (ImageTypeEnum)
Default: "jpeg"
Enum: "jpeg" "png" "gif"
Class representing all the image type accepted values

Responses

Response samples

Content type
application/json
null

health

Health

Checks if the service and all of its dependencies are working and returns a descriptive json

Responses

Response samples

Content type
application/json
null

Health Ready

Checks if the service is up and essential dependencies are running correctly

Responses

Response samples

Content type
application/json
null

Health Live

Checks if the service is up

Responses

Response samples

Content type
application/json
null