File

Processes a file and returns the result.

Processes a file and returns the result.

get/{accountId}/{transformation}{filePath}

Path parameters

accountIdstring required

Your account ID.

This is visible on the settings page:

https://www.bytescale.com/dashboard/settings

Example:A623uY2
filePathstring required

Absolute path to a file. Begins with a /.

Example:/uploads/image.jpg
transformationstring required

The name of the File Processing API (e.g. image, video, audio) or transformation preset (created in the Bytescale Dashboard) to use when processing the file.

Example:image

The name of the File Processing API (e.g. image, video, audio) or transformation preset (created in the Bytescale Dashboard) to use when processing the file.

Query parameters

TransformationParamsGroup

A single group of transformation parameters provided to a Bytescale File Processing API.

See TransformationParams for more information.

OR
TransformationParamsGroup[]

Each File Processing API requires additional query string parameters to specify the desired transformation behavior.

For details, refer to the relevant documentation:

artifactstring

Path to an artifact generated by the transformation.

All image transformations output the transformed image to the "/" artifact. Video transformations may output multiple artifacts.

Default: "/"

Example:/example/video/part-a.ts

Some transformations output multiple files, called artifacts.

You can download each individual transformation artifact by specifying its path with this parameter

cacheboolean
Example:true

Specifies whether to cache the transformed result.

If set to false the transformation will be executed on every request.

Recommendation: instead of disabling the cache, a more performant solution is to use the version or v parameter and to increment it each time you require an updated result.

Default: true

cache-onlyboolean

Only serve transformations from the cache; do not perform new transformations on cache miss.

If true, then if the transformation result does not exist in the cache, a 404 will be returned. No transformations will be performed.

If false, then if the transformation result does not exist in the cache, a new transformation will be performed to produce the result.

Default: false

cache-perm'auto' | 'false' | 'true'
Example:auto

Specifies whether to cache the transformed result in the Bytescale CDN perma-cache.

Perma-caching works by storing your file permanently, or until a manual cache purge is performed.

When cache=false this parameter is automatically set to false.

When cache-perm=auto the perma-cache will only be used for files that take more than 500ms to process.

When the perma-cache is used, approximately 200ms of latency is added to the initial request. Thereafter, files will be served from the Bytescale CDN's edge cache or perma-cache, so will have minimal latency.

Default: Please refer to your account's default cache settings in the Bytescale Dashboard.

cache-ttlnumber
Example:31536000

Specifies the maximum amount of time, in seconds, the transformed result will be cached on the user's device and in the Bytescale CDN's edge cache.

If the file is perma-cached, then the file will not be reprocessed on edge cache misses.

If the file is not perma-cached, then the file will be reprocessed on edge cache misses.

For more information on perma-caching, see: cache-perm

Default: Please refer to your account's default cache settings in the Bytescale Dashboard.

cache-ttl-404number
Example:31536000

Specifies the maximum amount of time, in seconds, that 404 responses will be cached in the Bytescale CDN's edge cache.

Default: Please refer to your account's default cache settings in the Bytescale Dashboard.

number
OR
'inf'
Example:1748005508

Expires the URL at the given time.

Accepted values:

  • An integer (in milliseconds or seconds since January 1, 1970, 00:00:00 UTC)

  • The literal string inf to indicate that the URL should never expire (the default)

See: Expiring URLs

versionstring
Example:1

Add this parameter and increment its value to force the file to be reprocessed.

The Bytescale CDN caches files based on the full URL (including the querystring), meaning this parameter is useful when dealing with changes made to transformation presets. By contrast, File Processing APIs (like the Image Processing API) shouldn't ever require this parameter, since the URL/querystring naturally changes each time you adjust a parameter, causing a cache miss and the file to be reprocessed with the new querystring parameters.

The value of the version parameter can be anything, e.g. an incremental number, a timestamp, etc.

You only need to provide and update this value if/when you make changes to a transformation preset's settings.

Response

Success.

Changes

No recorded changes to this endpoint across all 1 revision of this API.