/v1/files/readFile/:filepathOrId
post
Path Parameters
Optional

FieldTypeRequiredDescription
filepathOrIdstringNo

File path with workspace rootname (case insensitive) or file ID

Example: /workspace-rootname/folder/file.ext or file000-remaining-file-id

Request Headers
HttpEndpointRequestHeaders_AuthOptional_JsonContentType
Optional

FieldTypeRequiredDescription
AuthorizationstringNo

Access token

Example: Bearer <token>

Content-TypestringYes

HTTP JSON request content type

Example: application/json

Request Query
Optional

FieldTypeRequiredDescription
wnumberNo

Resize to width if file is an image

Number subset: floating point or integer

hnumberNo

Resize to height if file is an image

Number subset: floating point or integer

posstring or numberNo

Gravity or strategy to use when fit is cover or contain

Enum: topright toprightright bottombottomleft bottomleftleft topnorthnortheasteastsoutheastsouthsouthwestwestnorthwestcentreentropyattention

Position to use when fit is cover or contain

Number subset: floating point or integer

fitstringNo

How the image should be resized to fit provided dimensions

Enum: containcoverfillinsideoutside

bgstringNo

Hex background color to use when fit is contain

Example: #FFFFFF

withoutEnlargementbooleanNo

Do not enlarge if the width or height are already less than provided dimensions

formatstringNo

Format to transform image to if file is an image

Enum: jpegpngwebptiffraw

downloadbooleanNo

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

Request Body
ReadFileEndpointParams
Optional

{
filepath?: string
fileId?: string
imageResize?: ImageResizeParams
imageFormat?: string
download?: boolean
}
ImageResizeParams
Optional

{
width?: number
height?: number
fit?: string
position?: string | number
background?: string
withoutEnlargement?: boolean
}
200 Response Headers
Optional

FieldTypeRequiredDescription
Content-TypestringYes

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

Content-LengthstringYes

HTTP response content length in bytes

Content-DispositionstringNo

HTTP response content disposition

200 Response Body
binary
4XX or 5XX Response Headers
HttpEndpointResponseHeaders_ContentType_ContentLength
Optional

FieldTypeRequiredDescription
Content-TypestringYes

HTTP JSON response content type

Example: application/json

Content-LengthstringYes

HTTP response content length in bytes

4XX or 5XX Response Body
EndpointErrorResult
Optional

Endpoint error result

{
errors?: Array<OperationError>
}
OperationError
Optional

{
name: string
message: string
action?: string
field?: string
notes?: Array<EndpointResultNote>
}
EndpointResultNote
Optional

{
code: string
message: string
}
    fimidara — docs