This Utility API creates a preview image for a diverse range of file formats.
It accepts a source file and specific dimensions (height and width) to generate a compact and resized preview of the original file.
File previews serve as a versatile solution, catering to various applications by optimizing the visual experience and enhancing overall performance. Whether for web or mobile applications, the generated previews offer a practical way to conserve bandwidth, especially in scenarios with limited or slower network connections.
upload file: download file
The method enables you to submit a file and receive the corresponding file-preview as an image. This straightforward approach allows you to pass a file and obtain the generated file-preview in the response.
|The name of the preview image file. If no output attribute is provided, the default file name will be
|The preferred width for the image preview, specified in pixels. For example, the input might be
width : 500, with a default value of
|The preferred height for the image preview, specified in pixels. For example, the input might be
height : 500 . The default height is adjusted proportionally in accordance with the original image's aspect ratio of width.
|If auto_orientation is set to
true, it will enable the API to read the Exif data (if available) and automatically rotate the image based on the orientation information in the Exif metadata, by default it is
|The timestamp in seconds at which you wish to generate the preview, exclusively for video files. For instance, if a video spans 3 minutes and you want to generate a preview at the 90th second, the input would be
time: 90. The
default is 1, indicating the generation of a preview at the first second of the video.
|The document page you wish to generate a preview for, applicable only to textual file types ,such as docx, pdf, ppt, xlsx, etc. For instance, the input could be
page: 9, with a default value of
|The source file can be of any type, such as video, audio, image, document, spreadsheet, and more. Regardless of the file type, this service accommodates a wide range of formats for seamless processing, providing a default image in cases where generating a file preview is not feasible for the given format
HTTP Response Codes
The method may return one of the following HTTP status codes:
|The request was successful.
|Request is invalid or file is not accessible.
|Required authentication information is either missing or not valid for the resource.
|There was an error in processing this request.
All requests to ApyHub services need to be authenticated, currently we support
basic authentication mechanisms.
You can generate and view your existing credentials from workspace settings (on the left side of the navbar) and go to applications.
Points to note:
- Credential secrets are generated on the fly and are not stored in plain text, so on generating a credential please save the secrets somewhere safe.
- Use the
apy-tokenas the header parameter to pass the token.
- Use the
Authorizationheader to send the basic authentication credentials.
To search for a specific error code, enter the code in the search box below. Alternatively, you can click on the button to view a complete list of all error codes.