ByteChef LogoByteChef
Components

Microsoft OneDrive

Microsoft OneDrive is a cloud storage service provided by Microsoft for storing, accessing, and sharing files online.

Categories: File Storage

Type: microsoftOneDrive/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue
tenantIdTenant IdSTRINGtrue

Actions

Copy File

Name: copyFile

Copy a selected file to a different location within Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
idFile IDSTRINGID of the file to copy.true
nameNew File NameSTRINGThe new name for the copy. If this isn't provided, the same name will be used as the original.false
parentIdDestination Folder IDSTRINGThe ID of the folder where the copied file will be stored. If not specified, the root folder will be used.false

Example JSON Structure

{
  "label" : "Copy File",
  "name" : "copyFile",
  "parameters" : {
    "id" : "",
    "name" : "",
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/copyFile"
}

Output

This action does not produce any output.

Create New Folder

Name: createNewFolder

Creates a new empty folder in Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
nameFolder NameSTRINGThe name of the new folder.true
parentIdParent Folder IDSTRINGID of the folder where the new folder will be created; if no folder is selected, the folder will be created in the root folder.false

Example JSON Structure

{
  "label" : "Create New Folder",
  "name" : "createNewFolder",
  "parameters" : {
    "name" : "",
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/createNewFolder"
}

Output

Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the folder was created.
eTagSTRING
idSTRINGID of the folder.
lastModifiedDateTimeDATE_TIMEThe date and time when the folder was last modified.
nameSTRINGName of the folder.
sizeINTEGERSize of the folder in bytes.
webUrlSTRINGURL to access the folder in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
folderOBJECT
Properties {INTEGER(childCount)}

Output Example

{
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "folder" : {
    "childCount" : 1
  }
}

Create New Text File

Name: createNewTextFile

Creates a new text file in Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
nameFile NameSTRINGThe name of the new text file.true
textTextSTRINGThe text content to add to file.true
mimeTypeFile TypeSTRING
Options plain/text, text/csv, text/xml
Select file type.true
parentIdParent Folder IDSTRINGID of the folder where the file should be created; if no folder is selected, the file will be created in the root folder.false

Example JSON Structure

{
  "label" : "Create New Text File",
  "name" : "createNewTextFile",
  "parameters" : {
    "name" : "",
    "text" : "",
    "mimeType" : "",
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/createNewTextFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the file was created.
eTagSTRING
idSTRINGID of the file.
lastModifiedDateTimeDATE_TIMEThe date and time when the file was last modified.
nameSTRINGName of the created file.
sizeINTEGERSize of the file in bytes.
webUrlSTRINGURL to access the file in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
fileOBJECT
Properties {{STRING(quickXorHash)}(hashes), STRING(mimeType)}

Output Example

{
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "file" : {
    "hashes" : {
      "quickXorHash" : ""
    },
    "mimeType" : ""
  }
}

Delete File

Name: deleteFile

Delete a selected file from Microsoft One Drive.

Properties

NameLabelTypeDescriptionRequired
idFile IDSTRINGThe id of a file to delete.true

Example JSON Structure

{
  "label" : "Delete File",
  "name" : "deleteFile",
  "parameters" : {
    "id" : ""
  },
  "type" : "microsoftOneDrive/v1/deleteFile"
}

Output

This action does not produce any output.

Download File

Name: downloadFile

Download a file from your Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
idFile IDSTRINGID of the file to download.true

Example JSON Structure

{
  "label" : "Download File",
  "name" : "downloadFile",
  "parameters" : {
    "id" : ""
  },
  "type" : "microsoftOneDrive/v1/downloadFile"
}

Output

Type: FILE_ENTRY

Properties

NameTypeDescription
extensionSTRING
mimeTypeSTRING
nameSTRING
urlSTRING

Output Example

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

Get File

Name: getFile

Retrieve a specified file from your Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
idFile IDSTRINGID of the file to retrieve.true

Example JSON Structure

{
  "label" : "Get File",
  "name" : "getFile",
  "parameters" : {
    "id" : ""
  },
  "type" : "microsoftOneDrive/v1/getFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the file was created.
eTagSTRING
idSTRINGID of the file.
lastModifiedDateTimeDATE_TIMEThe date and time when the file was last modified.
nameSTRINGName of the created file.
sizeINTEGERSize of the file in bytes.
webUrlSTRINGURL to access the file in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
fileOBJECT
Properties {{STRING(quickXorHash)}(hashes), STRING(mimeType)}

Output Example

{
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "file" : {
    "hashes" : {
      "quickXorHash" : ""
    },
    "mimeType" : ""
  }
}

List Files

Name: listFiles

List files in a OneDrive folder.

Properties

NameLabelTypeDescriptionRequired
parentIdParent Folder IDSTRINGID of the folder from which you want to list files. If no folder is specified, the root folder will be used.false

Example JSON Structure

{
  "label" : "List Files",
  "name" : "listFiles",
  "parameters" : {
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/listFiles"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the file was created.
eTagSTRING
idSTRINGID of the file.
lastModifiedDateTimeDATE_TIMEThe date and time when the file was last modified.
nameSTRINGName of the created file.
sizeINTEGERSize of the file in bytes.
webUrlSTRINGURL to access the file in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
fileOBJECT
Properties {{STRING(quickXorHash)}(hashes), STRING(mimeType)}

Output Example

[ {
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "file" : {
    "hashes" : {
      "quickXorHash" : ""
    },
    "mimeType" : ""
  }
} ]

List Folders

Name: listFolders

List folders in a OneDrive folder.

Properties

NameLabelTypeDescriptionRequired
parentIdParent Folder IDSTRINGID of the Folder from which you want to list folders. If no folder is specified, the root folder will be used.false

Example JSON Structure

{
  "label" : "List Folders",
  "name" : "listFolders",
  "parameters" : {
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/listFolders"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the folder was created.
eTagSTRING
idSTRINGID of the folder.
lastModifiedDateTimeDATE_TIMEThe date and time when the folder was last modified.
nameSTRINGName of the folder.
sizeINTEGERSize of the folder in bytes.
webUrlSTRINGURL to access the folder in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
folderOBJECT
Properties {INTEGER(childCount)}

Output Example

[ {
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "folder" : {
    "childCount" : 1
  }
} ]

Upload File

Name: uploadFile

Upload a file to your Microsoft OneDrive.

Properties

NameLabelTypeDescriptionRequired
parentIdParent Folder IDSTRINGID of the Folder where the file should be uploaded; if no folder is selected, the file will be uploaded in the root folder.false
fileFileFILE_ENTRYFile to upload.true

Example JSON Structure

{
  "label" : "Upload File",
  "name" : "uploadFile",
  "parameters" : {
    "parentId" : "",
    "file" : {
      "extension" : "",
      "mimeType" : "",
      "name" : "",
      "url" : ""
    }
  },
  "type" : "microsoftOneDrive/v1/uploadFile"
}

Output

Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the file was created.
eTagSTRING
idSTRINGID of the file.
lastModifiedDateTimeDATE_TIMEThe date and time when the file was last modified.
nameSTRINGName of the created file.
sizeINTEGERSize of the file in bytes.
webUrlSTRINGURL to access the file in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
fileOBJECT
Properties {{STRING(quickXorHash)}(hashes), STRING(mimeType)}

Output Example

{
  "createdDateTime" : "2021-01-01T00:00:00",
  "eTag" : "",
  "id" : "",
  "lastModifiedDateTime" : "2021-01-01T00:00:00",
  "name" : "",
  "size" : 1,
  "webUrl" : "",
  "createdBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "lastModifiedBy" : {
    "user" : {
      "id" : "",
      "displayName" : ""
    }
  },
  "file" : {
    "hashes" : {
      "quickXorHash" : ""
    },
    "mimeType" : ""
  }
}

Triggers

New File

Name: newFile

Triggers when file is uploaded to folder.

Type: POLLING

Properties

NameLabelTypeDescriptionRequired
parentIdParent Folder IDSTRINGIf no folder is specified, the root folder will be used.false

Output

Type: OBJECT

Properties

NameTypeDescription
createdDateTimeDATE_TIMEThe date and time when the file was created.
eTagSTRING
idSTRINGID of the file.
lastModifiedDateTimeDATE_TIMEThe date and time when the file was last modified.
nameSTRINGName of the created file.
sizeINTEGERSize of the file in bytes.
webUrlSTRINGURL to access the file in a web browser.
createdByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
lastModifiedByOBJECT
Properties {{STRING(id), STRING(displayName)}(user)}
fileOBJECT
Properties {{STRING(quickXorHash)}(hashes), STRING(mimeType)}

JSON Example

{
  "label" : "New File",
  "name" : "newFile",
  "parameters" : {
    "parentId" : ""
  },
  "type" : "microsoftOneDrive/v1/newFile"
}

What to do if your action is not listed here?

If this component doesn't have the action you need, you can use Custom Action to create your own. Custom Actions empower you to define HTTP requests tailored to your specific requirements, allowing for greater flexibility in integrating with external services or APIs.

To create a Custom Action, simply specify the desired HTTP method, path, and any necessary parameters. This way, you can extend the functionality of your component beyond the predefined actions, ensuring that you can meet all your integration needs effectively.