Skip to main content

Read file data / Get file

The GET method can be used in two ways:

  • Read data associated with the file.
  • Download the file.

Reading data from the endpoint is done like in the CRUD READ endpoint.

To download the file you simply need to specify a single uniqueId and use the parameter fileOnly=true in the URL.

Request data

HTTP method: GET

URL format: https://baseUrl/versionNumber/customEndpointRoute/userEndpoint?key=apiKey[&uniqueId=uniqueId][&fileOnly=true]


Request Parameters

The following table describes the Request parameters.

baseUrlBase url for calling the API.


versionNumberService version.

Value: The current value is 1.

customEndpointRouteThe route which identifies custom endpoints.

Default value: ce

userEndpointThe endpoint name generated by the user.

Value: the name created at

apiKeyThe API Key of the project.Yes
uniqueIdIf used, the endpoint will only serve the record with a matching uniqueId.

It is also possible to provide multiple uniqueId's.

If none is passed, the endpoint will serve all the records.

fileOnlyUse this to download the file, or use it in a HTML tag, such as img or video.

To use this you must provide a single uniqueId.

Value: true

When dealing with video files intended for use within the HTML video tag, employ this parameter in conjunction with fileOnly=true. Together, these settings facilitate effective communication between the server and the browser by ensuring the server comprehends partial requests and responds appropriately. Omitting these parameters may lead the server to attempt sending the entire video in one go, a method that may not be compatible with certain browsers.

Value: true
dataOnlyIf used, the endpoint will only serve the user data. It won’t include fields such as uniqueId, createdAt, updateAt.

Value: true

masterKeyOverrides the need for Access tokens or restrictions applied to Authentication endpoints.

Don't use this key in your client application.

For more information please refer to projects.

Value: the masterKey created at


Use this parameter to query, filter, sort and transform your data (and more!)

It accepts JSONata compatible expressions.

The evaluation of the expression is applied to the output of the endpoint, including when other parameters are used (e.g. dataOnly).

Check the JSONata documentation on their page, or check our quick guide, JSONata, query and transform.

Note: Not applicable when fileOnly is used.


Request Cookies


The Access token is required for secure endpoints.

It is obtained when doing a login and it is stored in an httpOnly cookie. To automatically include it in the request you need to set the following property:

// using fetch { credentials: 'include' } // using axios { withCredentials: true }

Alternatively you can also use the Authorization header.

For more information please refer to  the login documentation and Secure Endpoints documentation.
Yes - if endpoint is secure and Authorization header is not used

Request Headers


The Access token is required for secure endpoints.

You should use this header if you are not using the httpOnly cookie to access a Secure endpoint.

For more information please refer to  the login documentation and Secure Endpoints documentation.

Yes - if endpoint is secure and httpOnly cookie is not used


// to get all the data associated with files existing in the endpoint:

// With a single uniqueId:

// With multiple uniqueIds:

// To download the file:

Response data

Error codes

Error codeDescription
400Possible reasons:
  • Endpoint or API Key not valid.
  • No file.
  • fileOnly parameter used without a single uniqueId.
401If the endpoint is secure and the access token is missing or is not valid.

It may also return this error if the user no longer exists.

403Missing API Key, not allowed origin or disallowed request without orign.

Successful response

"uniqueId": "0bbf487842334d2d906d7473689886d5",
"data": {
"metadata": {},
"contentType": "image/png",
"mimetype": "image/png",
"size": 295217,
"originalname": "Screenshot from 2021-01-12 11-09-05.png",
"fileURL": "https://localhost:8443/api/1/ce/files%3E%3E%3EScreenshot%20from%202021-01-12%2011-09-05.png?key=1ca09ab323ac4c12b82c4ca4591e922e&uniqueId=0bbf487842334d2d906d7473689886d5&fileOnly=true"
"createdAt": "2021-02-19T15:56:13.000Z",
"updatedAt": "2021-02-19T15:56:13.000Z"

To download the file you can use the fileURL provided in the response.