/v1/files/readFile/:filepathOrId
post
Path parameters for identifying a file by either filepath or file ID
Field | Type | Required | Description |
---|---|---|---|
filepathOrId | string | No | File path with workspace rootname (case insensitive) or file ID for flexible file identification Example: /workspace-rootname/folder/file.ext |
Field | Type | Required | Description |
---|---|---|---|
Authorization | string | No | Access token Example: Bearer <token> |
Content-Type | string | Yes | HTTP JSON request content type Example: application/json |
Query parameters for the read file HTTP endpoint
Field | Type | Required | Description |
---|---|---|---|
w | number | No | Resize to width if file is an image Number subset: Example: 600 |
h | number | No | Resize to height if file is an image Number subset: Example: 400 |
pos | string or number | No | Position or gravity to use when fit is cover or contain Gravity or strategy to use when fit is cover or contain Enum: Example: center Position to use when fit is cover or contain Number subset: Example: 5 |
fit | string | No | How the image should be resized to fit provided dimensions Enum: Example: cover |
bg | string | No | Hex background color to use when fit is contain Example: #FFFFFF |
withoutEnlargement | boolean | No | Do not enlarge if the width or height are already less than provided dimensions Example: |
format | string | No | Format to transform image to if file is an image Enum: Example: webp |
download | boolean | No | Whether the server should add "Content-Disposition: attachment" header which forces browsers to download files like HTML, JPEG, etc. which it'll otherwise open in the browser |
Parameters for reading/downloading a file with optional image processing
Parameters for resizing images on-the-fly during file retrieval
HTTP response headers for file read operations
Field | Type | Required | Description |
---|---|---|---|
Content-Type | string | Yes | Get file endpoint result content type. If request is successful, it will be the file's content type if it is known or application/octet-stream otherwise, and application/json containing errors if request fails Example: image/jpeg |
Content-Length | string | Yes | HTTP response content length in bytes Example: 1024 |
Content-Disposition | string | No | HTTP response content disposition Example: attachment; filename="file.txt" |
binary
Field | Type | Required | Description |
---|---|---|---|
Content-Type | string | Yes | HTTP JSON response content type Example: application/json |
Content-Length | string | Yes | HTTP response content length in bytes |