Preview files in a default dataset

Preview files in a default dataset

Preview files and directories in a default dataset for the given prefix, with support for wildcards. This is an internal API used when starting a transformation job.

POSThttps://studio.edgeimpulse.com/v1/api/organizations/{organizationId}/dataset/{dataset}/files/preview
Path parameters
organizationId*integer

Organization ID

dataset*string

Dataset name

Body
prefix*string

S3 prefix

itemsToList*enum

Return either files or folders matching the specified prefix

filesfolders
Response

OK

Body
success*boolean

Whether the operation succeeded

errorstring

Optional error description (set if 'success' was false)

files*array of PortalFile (object)
isTruncatedboolean

True if results are truncated.

truncationReasonenum

Explains why results are truncated; only present in the response if isTruncated is true. Results can be truncated if there are too many results (more than 500 matches), or if searching for more results is too expensive (for example, the dataset contains many items but very few match the given wildcard).

too-many-resultstoo-expensive-search
Request
const response = await fetch('https://studio.edgeimpulse.com/v1/api/organizations/{organizationId}/dataset/{dataset}/files/preview', {
    method: 'POST',
    headers: {
      "Content-Type": "application/json"
    },
    body: JSON.stringify({
      "prefix": "text",
      "itemsToList": "files"
    }),
});
const data = await response.json();
Response
{
  "success": false,
  "error": "text",
  "files": [
    {
      "name": "text",
      "addedDate": "2019-07-21T17:32:28Z",
      "ETag": "text",
      "path": "text",
      "type": "folder"
    }
  ],
  "isTruncated": false,
  "truncationReason": "too-many-results"
}

Last updated