https://api.apyhub.com/generate/preview/file
POST
multipart/form-data
Attribute | Type | Mandatory | Description |
---|---|---|---|
output | String | No | The name of the preview image file. If no output attribute is provided, the default file name will be output.png . |
width | Integer | No | The preferred width for the image preview, specified in pixels. For example, the input might be width : 500 , with a default value of 840 . |
height | Integer | No | 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. |
auto_orientation | Boolean | No | 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 false . |
time | Integer | No | 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. |
page | Integer | No | 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 1 . |
Attribute | Type | Mandatory | Description |
---|---|---|---|
file | File | Yes | 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 when generating a file preview is not feasible for the given format. |
Status Code | Description |
---|---|
200 | The request was successful. |
400 | Request is invalid or file is not accessible. |
401 | Required authentication information is either missing or not valid for the resource. |
500 | There was an error in processing this request. |
tokens
or basic authentication
mechanisms.
You can generate and view your existing credentials from your workspace settings (on the left side of the navbar) and go to “API Keys".apy-token
as the header parameter to pass the token.Authorization
header to send the basic authentication credentials.