ByteChef LogoByteChef

Asset File

Work with ByteChef workspace asset files: upload, download, list, rename and delete binary files stored in the workspace asset file infrastructure.

Categories: Helpers

Type: assetFile/v1


Actions

Upload Asset File

Name: uploadAssetFile

Upload a workflow file entry into the asset file storage of the workspace owning this workflow. The file is stored in the environment the workflow runs in.

Properties

NameLabelTypeDescriptionRequired
fileFileFILE_ENTRYFile entry to upload.true
filenameFilenameSTRINGOptional filename override; defaults to the file entry's filename.false
contentTypeContent TypeSTRINGOptional content type override; defaults to the file entry's mime type.false

Example JSON Structure

{
  "label" : "Upload Asset File",
  "name" : "uploadAssetFile",
  "parameters" : {
    "file" : {
      "extension" : "",
      "mimeType" : "",
      "name" : "",
      "url" : ""
    },
    "filename" : "",
    "contentType" : ""
  },
  "type" : "assetFile/v1/uploadAssetFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idINTEGER
nameSTRING
descriptionSTRING
mimeTypeSTRING
sizeBytesINTEGER
sourceSTRINGSource of the file: USER_UPLOAD or AI_GENERATED.
tagIdsARRAY
Items [INTEGER]
createdDateDATE_TIME
createdBySTRING
lastModifiedDateDATE_TIME
lastModifiedBySTRING

Output Example

{
  "id" : 1,
  "name" : "",
  "description" : "",
  "mimeType" : "",
  "sizeBytes" : 1,
  "source" : "",
  "tagIds" : [ 1 ],
  "createdDate" : "2021-01-01T00:00:00",
  "createdBy" : "",
  "lastModifiedDate" : "2021-01-01T00:00:00",
  "lastModifiedBy" : ""
}

Download Asset File

Name: downloadAssetFile

Download the binary content of an asset file as a workflow file entry.

Properties

NameLabelTypeDescriptionRequired
assetFileIdAsset File IDINTEGERIdentifier of the asset file whose content to download.true

Example JSON Structure

{
  "label" : "Download Asset File",
  "name" : "downloadAssetFile",
  "parameters" : {
    "assetFileId" : 1
  },
  "type" : "assetFile/v1/downloadAssetFile"
}

Output

Type: FILE_ENTRY

Properties

NameTypeDescription
extensionSTRING
mimeTypeSTRING
nameSTRING
urlSTRING

Output Example

{
  "extension" : "",
  "mimeType" : "",
  "name" : "",
  "url" : ""
}

Get Asset File

Name: getAssetFile

Fetch metadata for a single asset file by id.

Properties

NameLabelTypeDescriptionRequired
assetFileIdAsset File IDINTEGERIdentifier of the asset file to fetch.true

Example JSON Structure

{
  "label" : "Get Asset File",
  "name" : "getAssetFile",
  "parameters" : {
    "assetFileId" : 1
  },
  "type" : "assetFile/v1/getAssetFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idINTEGER
nameSTRING
descriptionSTRING
mimeTypeSTRING
sizeBytesINTEGER
sourceSTRINGSource of the file: USER_UPLOAD or AI_GENERATED.
tagIdsARRAY
Items [INTEGER]
createdDateDATE_TIME
createdBySTRING
lastModifiedDateDATE_TIME
lastModifiedBySTRING

Output Example

{
  "id" : 1,
  "name" : "",
  "description" : "",
  "mimeType" : "",
  "sizeBytes" : 1,
  "source" : "",
  "tagIds" : [ 1 ],
  "createdDate" : "2021-01-01T00:00:00",
  "createdBy" : "",
  "lastModifiedDate" : "2021-01-01T00:00:00",
  "lastModifiedBy" : ""
}

Find Asset Files

Name: findAssetFiles

List the asset files of the workspace owning this workflow, in the environment the workflow runs in. Optionally filter by tag ids.

Properties

NameLabelTypeDescriptionRequired
tagIdsTag IDsARRAY
Items [INTEGER]
Optional list of tag ids to filter by; only files tagged with at least one of the given tags are returned.false

Example JSON Structure

{
  "label" : "Find Asset Files",
  "name" : "findAssetFiles",
  "parameters" : {
    "tagIds" : [ 1 ]
  },
  "type" : "assetFile/v1/findAssetFiles"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
idINTEGER
nameSTRING
descriptionSTRING
mimeTypeSTRING
sizeBytesINTEGER
sourceSTRINGSource of the file: USER_UPLOAD or AI_GENERATED.
tagIdsARRAY
Items [INTEGER]
createdDateDATE_TIME
createdBySTRING
lastModifiedDateDATE_TIME
lastModifiedBySTRING

Output Example

[ {
  "id" : 1,
  "name" : "",
  "description" : "",
  "mimeType" : "",
  "sizeBytes" : 1,
  "source" : "",
  "tagIds" : [ 1 ],
  "createdDate" : "2021-01-01T00:00:00",
  "createdBy" : "",
  "lastModifiedDate" : "2021-01-01T00:00:00",
  "lastModifiedBy" : ""
} ]

Update Asset File Content

Name: updateAssetFileContent

Replace the binary content of an existing asset file.

Properties

NameLabelTypeDescriptionRequired
assetFileIdAsset File IDINTEGERIdentifier of the asset file whose content to replace.true
fileFileFILE_ENTRYFile entry whose content replaces the existing asset file content.true
contentTypeContent TypeSTRINGOptional content type override; defaults to the file entry's mime type.false

Example JSON Structure

{
  "label" : "Update Asset File Content",
  "name" : "updateAssetFileContent",
  "parameters" : {
    "assetFileId" : 1,
    "file" : {
      "extension" : "",
      "mimeType" : "",
      "name" : "",
      "url" : ""
    },
    "contentType" : ""
  },
  "type" : "assetFile/v1/updateAssetFileContent"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idINTEGER
nameSTRING
descriptionSTRING
mimeTypeSTRING
sizeBytesINTEGER
sourceSTRINGSource of the file: USER_UPLOAD or AI_GENERATED.
tagIdsARRAY
Items [INTEGER]
createdDateDATE_TIME
createdBySTRING
lastModifiedDateDATE_TIME
lastModifiedBySTRING

Output Example

{
  "id" : 1,
  "name" : "",
  "description" : "",
  "mimeType" : "",
  "sizeBytes" : 1,
  "source" : "",
  "tagIds" : [ 1 ],
  "createdDate" : "2021-01-01T00:00:00",
  "createdBy" : "",
  "lastModifiedDate" : "2021-01-01T00:00:00",
  "lastModifiedBy" : ""
}

Rename Asset File

Name: renameAssetFile

Rename an asset file.

Properties

NameLabelTypeDescriptionRequired
assetFileIdAsset File IDINTEGERIdentifier of the asset file to rename.true
newNameNew NameSTRINGNew name for the asset file.true

Example JSON Structure

{
  "label" : "Rename Asset File",
  "name" : "renameAssetFile",
  "parameters" : {
    "assetFileId" : 1,
    "newName" : ""
  },
  "type" : "assetFile/v1/renameAssetFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idINTEGER
nameSTRING
descriptionSTRING
mimeTypeSTRING
sizeBytesINTEGER
sourceSTRINGSource of the file: USER_UPLOAD or AI_GENERATED.
tagIdsARRAY
Items [INTEGER]
createdDateDATE_TIME
createdBySTRING
lastModifiedDateDATE_TIME
lastModifiedBySTRING

Output Example

{
  "id" : 1,
  "name" : "",
  "description" : "",
  "mimeType" : "",
  "sizeBytes" : 1,
  "source" : "",
  "tagIds" : [ 1 ],
  "createdDate" : "2021-01-01T00:00:00",
  "createdBy" : "",
  "lastModifiedDate" : "2021-01-01T00:00:00",
  "lastModifiedBy" : ""
}

Delete Asset File

Name: deleteAssetFile

Delete an asset file by id.

Properties

NameLabelTypeDescriptionRequired
assetFileIdAsset File IDINTEGERIdentifier of the asset file to delete.true

Example JSON Structure

{
  "label" : "Delete Asset File",
  "name" : "deleteAssetFile",
  "parameters" : {
    "assetFileId" : 1
  },
  "type" : "assetFile/v1/deleteAssetFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
deletedBOOLEAN
Options true, false
assetFileIdINTEGER

Output Example

{
  "deleted" : false,
  "assetFileId" : 1
}

How is this guide?

Last updated on

On this page