Introduction

Enzo Server
  Installation
  Quick Start
  Core Features
    Async Calls
    ConnectionStrings
    Edge Cache
    HTTP Access
    Scheduling
    Views
  Advanced Capabilities
    Change Data Capture
  Administration
    Configuration Settings
    Logins & ACL
    Auditing
    Current Executions
    Linked Server
    SSL

  User Guides
     Sharding
     Sharding Overview

     SharePoint

   Adapters
    All Adapters


  SDK
    Overview
    Installation
    DevHost
    Create A Simple Adapter
    Handler Columns

    Advanced SDK Concepts
      Handler Decorators
      Dynamic Columns
      Table & Table Enumerators
      Virtual Tables



OneDrive365 Adapter








Provides access to OneDrive (Business) drives and files using SQL Server and REST commands.


This adapter requires advanced configuration with Azure AD and OAuth Configuration



OAuth Configuration

This adapter requires Azure AD and OAuth to be configured.

show steps 
  • Register an Application in Azure AD
    Register an application in your Azure Active Directory environment. This will automatically generate an Application ID. Also, note your TenantID in which the application has been created.
  • Find the Application Secret
    In the Azure AD Portal, locate the application secret (found under Certificates and Secrets).
  • Assign all necessary rights
    In the Azure AD portal, assign all Drive related Microsoft Graph rights Application Permissions) and click to Grant Admin Consent.
  • In Enzo Manager, create a Config Setting
    Create a new Configuration Setting for OneDrive365 and save the secrets obtained above, along with the Tenant ID.

Access Tokens are automatically created and refreshed when needed; to view the access tokens currently in use, use the ListTokens handler. These tokens can also be manually refreshed by calling the RefreshTokens handler.


Configuration Settings



Name Description Default
Boolean _isDefault Make this the default configuration. Defaults to true if configName is already the default.
String tenantId TenantId used for authentication
String appId AppId used for authentication
String clientSecret Client secret used for authentication
String defaultUserId The default userId to use if not provided when required

Handlers



createFolder
folders
Create new folder details 

Arguments

Name Description Default
folderName R
userId
parentFolder

SQL Call

EXEC OneDrive365.createFolder @folderName='Test Folder'
INSERT INTO OneDrive365.folders (folderName) VALUES ('test')


Http Call

/bsc/onedrive365/createfolder

Output Columns

This call does not return data.

deleteFile
files
Delete a file details 

Arguments

Name Description Default
fileId R
userId

SQL Call

EXEC OneDrive365.deleteFile  @fileId='fileid'
Delete from OneDrive365.files where fileId='fileid'


Http Call

/bsc/onedrive365/deletefile

Output Columns

This call does not return data.

deleteFolder
folders
Delete a folder details 

Arguments

Name Description Default
fileId R
userId

SQL Call

EXEC OneDrive365.deleteFolder @fileId='fileId'
Delete from OneDrive365.folders where fileId='fileid'


Http Call

/bsc/onedrive365/deletefolder

Output Columns

This call does not return data.

downloadFile
file
Download a file to a local or UNC path details 

Arguments

Name Description Default
fileName R
downloadPath
userId
override False
timeout 0
retryCount 3

SQL Call

EXEC OneDrive365.downloadFile @id='fileId',@downloadPath='D:\download'


Http Call

/bsc/onedrive365/downloadfile

Output Columns

String fileName
String tmpFileName
Int64 byteTx
Double elapsedTime
String userId
String id
String downloadPath
Boolean override
Int32 timeout
Int32 retryCount
listDrive
drive
Returns the list of drives details 

Arguments

Name Description Default
userId

SQL Call

exec OneDrive365.listDrive @userId='userid'
SELECT * FROM OneDrive365.drive where userId='userid'


Http Call

/bsc/onedrive365/listdrive

Output Columns

String id
String name
String description
String driveType
String weburl
String createdBy
DateTime createdDateTime
String lastModifiedBy
DateTime lastModifiedDateTime
String ownerUserId
String ownerName
String deleted
String remaining
String state
String total
String used
listFiles
files
Returns the list of files/folders that belong to a user drive details 

Arguments

Name Description Default
driveId R
userId
path
fileName
topn

SQL Call

exec OneDrive365.listFiles  'driveid'
SELECT * FROM OneDrive365.files where driveId='driveid'


Http Call

/bsc/onedrive365/listfiles

Output Columns

String id
String name
String graphPath
String webUrl
String size
String createdBy
DateTime createdDateTime
String lastModifiedBy
DateTime lastModifiedDateTime
Boolean isFolder
String path
String userId
String driveId
ListTokens
Tokens
Returns the list of available tokens (requires administrative access to view all tokens) details 

Arguments


SQL Call

exec OneDrive365.ListTokens 
SELECT * FROM OneDrive365.Tokens


Http Call

/bsc/onedrive365/listtokens

Output Columns

String token_type
String accessToken
Double expires_in
DateTime dateAcquired
listUsers
users
Returns the list of users details 

Arguments


SQL Call

exec OneDrive365.listUsers
SELECT * FROM OneDrive365.users


Http Call

/bsc/onedrive365/listusers

Output Columns

String id
String displayName
String jobTitle
String mail
String mobilePhone
RefreshToken
Forces the creation of a new access token for the current logged in user details 

Arguments


SQL Call

exec OneDrive365.RefreshToken 


Http Call

/bsc/onedrive365/refreshtoken

Output Columns

String token_type
String accessToken
Double expires_in
DateTime dateAcquired
renameFile
files
Rename an existing file details 

Arguments

Name Description Default
fileName R
id R
userId

SQL Call

EXEC OneDrive365.renameFile @fileName='testFile.doc',@id='fileId'
update OneDrive365.folders set fileName='testFile.doc' where id='fileid'


Http Call

/bsc/onedrive365/renamefile

Output Columns

This call does not return data.

renameFolder
folders
Rename an existing folder details 

Arguments

Name Description Default
fileName R
id R
userId

SQL Call

EXEC OneDrive365.renameFolder @fileName='test folder',@id='folderid'
update OneDrive365.folders set fileName='test rename' where id='id'


Http Call

/bsc/onedrive365/renamefolder

Output Columns

This call does not return data.

uploadFile
file
Upload a file to OneDrive details 

Arguments

Name Description Default
sourceFile R
fileName R
id
userId
override False
timeout 0

SQL Call

EXEC OneDrive365.uploadFile  @sourceFile='D:\Download\A100.pdf', @fileName='A100.pdf'


Http Call

/bsc/onedrive365/uploadfile

Output Columns

This call does not return data.