SharePoint
BotDojo can ingest documents directly from SharePoint Online document libraries with the Microsoft Graph API.
BotDojo can ingest documents directly from SharePoint Online document libraries with the Microsoft Graph API.
Prerequisites
-
Create or reuse an Azure AD (Microsoft Entra ID) application registration and add Microsoft Graph application permissions, not delegated permissions. Choose one option:
- Every site:
Sites.Read.AllandFiles.Read.All. BotDojo can list and read every site in the tenant. - Selected sites only:
Sites.Selected. BotDojo can read only the sites an administrator grants to the app.
- Every site:
-
Grant admin consent for those permissions and capture the following values:
- Tenant (Directory) ID
- Application (Client) ID
- Client secret (value, not the ID)
-
If you chose
Sites.Selected, grant the appReadon each site whose document libraries you want to sync. For example, with PnP PowerShell:Grant-PnPEntraIDAppSitePermission -AppId <application-client-id> -DisplayName "<app name>" -Site https://<tenant>.sharepoint.com/sites/<site> -Permissions ReadAccess to the tenant root site (
https://<tenant>.sharepoint.com) is optional.Files.SelectedOperations.SelectedandUser.Readare not needed.
Connect SharePoint in BotDojo
- Open Integrations → SharePoint and click Connect.
- Enter the Tenant ID, Application ID, and client secret from your Azure AD application, then save. BotDojo verifies the credentials by requesting a Graph access token and reading the tenant root site. If the app can't read the root site, which is common with
Sites.Selected, the test still passes and you open your site by URL in the picker.
Configure the SharePoint Document Loader
- Go to Data → Import Data (or create a new Data Loader from a Flow) and choose SharePoint.
- Click Browse SharePoint to launch the picker. The picker guides you through:
- Selecting the SharePoint site. If your site isn't listed, enter its URL (for example,
https://contoso.sharepoint.com/sites/Sales) and click Go. WithSites.Selected, the picker lists at most the root site (if granted) and its child sites, because Microsoft Graph site search requiresSites.Read.All, so open other sites this way. - Choosing the document library (drive)
- Optionally narrowing to a specific folder
- Selecting the SharePoint site. If your site isn't listed, enter its URL (for example,
- Confirm the destination path and schedule, then save the loader. The initial sync will crawl the selected library/folder and ingest supported file types (Office documents, PDF, text, markdown, etc.).
- Subsequent runs use Microsoft Graph delta queries, so only new or changed files are downloaded.
Notes & Troubleshooting
- If you move the SharePoint app registration to a different tenant, update the credentials in BotDojo.
- Permission errors typically indicate the app registration is missing admin consent or cannot see the selected site/library.
- If the connection test fails, check that the permissions were added as application permissions, not delegated, and that admin consent was granted.
- If opening a site by URL says the app doesn't have access, grant the app
Readon that site (see step 3 of the prerequisites). - Syncing Site Pages uses the Microsoft Graph pages API, which Microsoft documents as requiring
Sites.Read.All. Document libraries work with either permission option. - The integration uses the Microsoft Graph
drives/{drive-id}endpoints; make sure document libraries are not locked down to specific user accounts only.