Skip to main content
Learn how to connect Engini to OneDrive. OneDrive is Microsoft’s file-hosting service. With the OneDrive activities in Engini you can:
  • Get, copy, move, rename, download, upload and delete files and folders
  • Create folders and share links, and manage who can access a file or folder
  • Get your drives, the drives of a group or a SharePoint site, and search SharePoint sites
  • Start a workflow when a file or folder is created or updated
To get started with the OneDrive app, create an account for free at microsoft.com.

Getting Started with OneDrive

Prerequisites

  • A Microsoft account. The Get Sites action also needs a work or school Microsoft account.

Add a connection to OneDrive in Engini

  1. Enter to your Engini account at https://app.engini.io.
  2. Navigate to the Connections page by clicking on Connections in the left sidebar or by clicking here. Engini - Connections page
  3. Click on the “New Integration” option located at the top bar. Engini - New Integration button
  4. Choose the OneDrive option from the available applications. OneDrive - Choose Application
  5. Fill in the “New Integration” form and press Save: Note: There are two authentication methods available, and the form fields differ depending on the one you choose. Pick OAuth2 (the default) to sign in with your Microsoft account, with nothing else to set up. Pick Custom OAuth 2.0 if your organization requires you to connect through an app that you registered yourself in Microsoft Azure.

OAuth2

This is the default method. You sign in with your Microsoft account, so you don’t need to provide a Client Id or Client Secret. OneDrive - New Integration form, OAuth2
  1. Connection Name - Enter a name that helps identify the OneDrive connection.
  2. Authentication Method - Select OAuth2.
  3. Sign in with Microsoft - Click Sign in with Microsoft and sign in to your Microsoft account.
  4. Save - Click Save to create the connection.

Custom OAuth 2.0

Choose this method if you want Engini to connect through an app that you registered yourself in Microsoft Azure, instead of the default Microsoft sign-in. Create the app registration first, in the Azure portal, with these settings:
  • Supported account types: multitenant and personal Microsoft accounts.
  • Redirect URI: add a Web platform redirect URI, exactly https://workflowapi.engini.io/api/auth/OAuthRedirectUrl (the same address the Callback URL field below shows).
  • API permissions: add these delegated Microsoft Graph permissions: Files.ReadWrite.All, Sites.ReadWrite.All, Group.ReadWrite.All, User.Read and offline_access.
  • Client secret: create a client secret and copy its Value (not the Secret ID).
Then enter these details in the form: OneDrive - New Integration form, Custom OAuth 2.0
  1. Connection Name - Enter a name that helps identify the OneDrive connection.
  2. Authentication Method - Select Custom OAuth 2.0.
  3. Callback URL - A read-only field that shows the address Microsoft sends you back to after you sign in (https://workflowapi.engini.io/api/auth/OAuthRedirectUrl). Click the copy button next to it, then add this address as a Web redirect URI in the Azure app registration. Do this before you enter the Client Id and Client Secret, so that the sign-in works.
  4. Client Id - The Application (client) ID of your Azure app registration.
  5. Client Secret - The client secret Value created for your Azure app registration.
  6. Signin - Click Signin and sign in to your Microsoft account.
  7. Save - Click Save to create the connection.

Triggers

The triggers check OneDrive on a schedule and start the workflow when files or folders are created or updated.

Check for File/Folder Created

Starts the workflow for files or folders created in the OneDrive location you choose. OneDrive - Check for File/Folder Created trigger
  1. Files or Folders - Select what the trigger checks: Files, Folders, or Files and Folders.
  2. OneDrive Location - Select where to check: My Drive, Site’s Drive, Groups’ Drive or Shared With Me. Your choice adds the fields listed below the steps.
  3. Starting (UTC) - Select the start date and time for the scheduled trigger.
  4. Recur every - Choose the time interval for checking. The minimum time interval is 15 minutes.
  5. Add time frame - You can specify a time frame during which the trigger will operate.
The fields added by the location are:
  • My Drive: Drive Id, Folder Id and Query.
  • Site’s Drive: Query, Site Id, Drive Id and Folder Id.
  • Groups’ Drive: Query, Group Id, Drive Id and Folder Id.
  • Shared With Me: Query.
Select the Site Id, Group Id, Drive Id and Folder Id from the lists, or map them from an earlier step. Query searches by file or folder name. Each file or folder is passed to the next steps with these properties, among others: Id, Name, Web Url, Size, Created Date Time, Last Modified Date Time, Created By User, Last Modified By User, ETag and CTag.

Check for File/Folder Updated

Starts the workflow for files or folders updated in the OneDrive location you choose. OneDrive - Check for File/Folder Updated trigger
  1. Files or Folders - Select what the trigger checks: Files, Folders, or Files and Folders.
  2. OneDrive Location - Select where to check: My Drive, Site’s Drive, Groups’ Drive or Shared With Me. The fields it adds are the same as in Check for File/Folder Created.
  3. Starting (UTC) - Select the start date and time for the scheduled trigger.
  4. Recur every - Choose the time interval for checking. The minimum time interval is 15 minutes.
  5. Add time frame - You can specify a time frame during which the trigger will operate.
  6. Add Conditions - Click Add Conditions to define conditions that narrow down the data list and return only the relevant items. To learn more about using filters, click here.
Each file or folder is passed to the next steps with the same properties as in Check for File/Folder Created.

Actions

Several actions start with a Location. It sets which drive the file or folder is in, and the fields below it change to match:
  • My drive: Drive Id and File/Folder Id.
  • Site’s drive: Site Id, Drive Id and File/Folder Id.
  • Group’s drive: Group Id, Drive Id and File/Folder Id.
Select each Id from the list, or map it from an earlier step.

Add Permission to File/Folder (Send Invitation)

Gives recipients read or write access to a file or folder by invitation. OneDrive - Add Permission to File/Folder (Send Invitation) action
  1. Location - Select the location of the file or folder: My drive, Site’s drive or Group’s drive. The Id fields appear as described at the start of this section.
  2. Recipients - The recipients who get access. Map the array you built with Initialize Recipients Array and Append to Recipients Array.
  3. Roles - The roles to give the recipients, Read or Write. Map the array you built with Initialize Roles Array and Append to Roles Array.
  4. Require Sign In - Whether the recipient must sign in to view the shared item.
  5. Send Invitation - If true, a sharing link is sent to the recipient.

Copy File/Folder

Copies a file or folder into another folder. OneDrive - Copy File/Folder action
  1. Drive Id - Enter the Id of the drive that holds the file or folder.
  2. File/Folder Id - Enter the Id of the file or folder to copy.
  3. Target Location - Select where to copy it: My Drive, Site’s drive or Group’s drive. Your choice adds To Drive Id and To Folder Id, plus To Site Id or To Group Id for a site or group drive, to pick the destination, and a New name for the copy.
  4. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.

Create Folder

Creates a new folder in OneDrive. OneDrive - Create Folder action
  1. Location - Select where to create the folder: My drive, Site’s drive or Group’s drive. Your choice adds the Site Id or Group Id, Drive Id and Folder Id of the parent folder.
  2. Folder name - Enter the name of the new folder.
Creates a sharing link for a file or folder. OneDrive - Create Share Link action
  1. Location - Select the location of the file or folder. The Id fields appear as described at the start of this section.
  2. Type - Select the type of link: View (anyone with the link can view), Edit (anyone with the link can edit) or Embed (a link you can embed in other pages).
  3. Add Field - Click Add Field to add and populate additional fields for the selected activity: Scope (Anonymous, Organization or Users) and Password. To learn more about managing activity data, click here.

Delete File/Folder

Deletes a file or folder from OneDrive. OneDrive - Delete File/Folder action
  • Location - Select the location of the file or folder you want to delete.
The Id fields appear as described at the start of this section. Select the file or folder to delete.

Delete File/Folder Permission

Removes a permission from a file or folder. OneDrive - Delete File/Folder Permission action
  1. Location - Select the location of the file or folder. The Id fields appear as described at the start of this section.
  2. Permission Id - Enter the Id of the permission to remove. You can get it with Get Permissions.

Download File

Downloads a file from OneDrive. OneDrive - Download File action
  • Location - Select the location of the file you want to download.
The Id fields appear as described at the start of this section. Select the file to download.

Get Drives

Gets the drives available in a location. OneDrive - Get Drives action
  • OneDrive Location - Select My Drive, Site’s Drive or Group’s Drive.
For a site drive, then select the Site Id. For a group drive, select the Group Id.

Get File/Folder Info

Gets the details of a file or folder. OneDrive - Get File/Folder Info action
  • Location - Select the location of the file or folder.
The Id fields appear as described at the start of this section. Select the file or folder.

Get Files/Folders

Gets files and folders from a OneDrive location. OneDrive - Get Files/Folders action
  1. Files or Folders - Select what to get: Files, Folders, or Files and Folders.
  2. OneDrive Location - Select My Drive, Site’s Drive, Groups’ Drive or Shared With Me. Your choice adds the same fields as the triggers: Drive Id and Folder Id (with Site Id or Group Id for those drives), and Query to search by file or folder name.

Get Permissions

Gets the permissions of a file or folder. OneDrive - Get Permissions action
  • Location - Select the location of the file or folder.
The Id fields appear as described at the start of this section. Select the file or folder.

Get Sites

Searches the SharePoint sites of your Microsoft 365 account by keyword. It needs a work or school Microsoft account. OneDrive - Get Sites action
  • Search - Enter a keyword to search site names for, for example Marketing.
Each site is passed to the next steps with these properties: Id, Name, Display Name, Web Url, Created Date Time and Last Modified Date Time.

Get User Drive

Gets your own OneDrive drive. OneDrive - Get User Drive action This action has no fields to fill in.

Move File/Folder

Moves a file or folder to another folder. OneDrive - Move File/Folder action
  1. Drive Id - Enter the Id of the drive that holds the file or folder.
  2. File/Folder Id - Enter the Id of the file or folder to move.
  3. Target Location - Select where to move it: My Drive, Site’s drive or Group’s drive. Your choice adds To Drive Id and To Folder Id, plus To Site Id or To Group Id for a site or group drive, to pick the destination, and a New name.

Rename File/Folder

Renames a file or folder. OneDrive - Rename File/Folder action
  1. File or Folder - Select File or Folder.
  2. Location - Select the location of the item. The Id fields appear as described at the start of this section.
  3. New name - Enter the new name.

Upload File

Uploads a file to OneDrive. OneDrive - Upload File action
  1. Location - Select where to upload: My drive, Site’s drive or Group’s drive. Your choice adds the Site Id or Group Id, Drive Id and Folder Id of the destination folder.
  2. File Name - Required. The name the file gets in OneDrive, including its extension, for example report.pdf.
  3. File Content - Required. The content of the file as a base64 string, for example the base64 content of a file produced by a previous step.
  4. File Type - Optional. The type of the file, for example application/pdf. If you leave it empty, it is detected automatically.
The three file fields are grouped under File in the panel.

Initialize Recipients Array

Creates an empty recipients array that you can fill with Append to Recipients Array and use in Add Permission to File/Folder. OneDrive - Initialize Recipients Array action
  1. Variable name - Enter the name of the variable that holds the array. You use this name whenever you refer to the array in the workflow.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.

Append to Recipients Array

Adds a recipient to the end of a recipients array that you created with Initialize Recipients Array. OneDrive - Append to Recipients Array action
  1. Variable - Select the recipients array variable to append to.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.

Initialize Roles Array

Creates an empty roles array that you can fill with Append to Roles Array and use in Add Permission to File/Folder. OneDrive - Initialize Roles Array action
  1. Variable name - Enter the name of the variable that holds the array. You use this name whenever you refer to the array in the workflow.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.

Append to Roles Array

Adds a role to the end of a roles array that you created with Initialize Roles Array. OneDrive - Append to Roles Array action
  1. Variable - Select the roles array variable to append to.
  2. Add Field - Click Add Field to add and populate additional fields for the selected activity. To learn more about managing activity data, click here.

Send API Request

This activity allows you to send a custom API request directly to the Microsoft Graph API that OneDrive uses. OneDrive - Send API Request action
  1. Base Url - The root URL of the API. It is filled in from your OneDrive connection and can’t be edited here.
  2. Relative url - You can specify additional path segments or parameters that need to be added to the end of the Base Url. This allows you to customize the specific request you want to perform.
  3. Method - Select the HTTP method (e.g., Get, Post, Put, Delete, Patch). The default is POST.
  4. Body Type - Defines the format of the data in the body of your request. The default, application/json, means the body contains a JSON-formatted payload.
    • application/json – Sends the request body in JSON format. Commonly used by REST APIs.
    • custom – Allows you to define a custom body format by manually setting the Content-Type header. Add a Content-Type row in Add Headers with the media type you need (for example application/xml). With any other Body Type, a Content-Type you type in Add Headers is not sent; Engini sets it from the Body Type, and the run history shows it under headersnotsent.
    • application/x-www-form-urlencoded – Sends the body as URL-encoded key-value pairs, commonly used in form submissions.
    • file – Sends a file as the request body.
    • multipart/form-data – Sends form data that may include both text fields and files.
    • text/html – Sends the request body as HTML content.
    • text/plain – Sends the request body as plain text.
    • text/xml – Sends the request body in XML format.
  5. Body - Contains any data that is being sent to the server.
  6. Add Headers - Additional metadata about the request, such as the type of data Engini can accept, the length of the request body, and authentication information.
  7. Add Queries - The query refers to the parameters or data that are included in the URL of an HTTP request to provide additional information or instructions to the server.
For the full list of endpoints, see the Microsoft Graph API reference.