Skip to main content

SharePoint Integration

Want to access and manage SharePoint content in your workflows? Use our SharePoint components to securely connect your tenant, list files, retrieve sites, and automate document-based processes.

TL;DR
Connect to SharePoint via Microsoft Entra OAuth. Use the SmythOS Vault to store sensitive credentials like Client ID and Client Secret, then power agents with components like Get Root Site, List Drive Items, and Search Site.

List of SharePoint Components​

ComponentActionWhat it DoesInputsKey OutputsUse Case
Get Root SiteReadRetrieves the root site of your SharePoint tenant.required tenant-nameid, displayName, nameIdentify root site metadata to anchor other calls.
Search SiteQuerySearches for a team site using a query.required queryvalueLocate a team site by keyword or group ID.
List All SitesReadLists all SharePoint sites in the tenant.required triggersitesDisplay site options for downstream selection.
List Site Drive ItemsReadLists files/folders in a SharePoint drive.required site_iditemsRetrieve and manage content from a drive.

Getting Started with SharePoint​

Step 1: Register in Microsoft Entra​

  1. Go to the Microsoft Entra Portal
  2. Navigate to Azure Active Directory > App registrations
  3. Click New registration
  4. Fill in:
    • Name: e.g., SmythOS Agent Access
    • Redirect URI: https://app.smythos.com/oauth/oauth2/callback
  5. After registration:
    • Copy the Client ID
    • Go to Certificates & secrets > New client secret
    • Copy the generated secret

Step 2: Assign Microsoft Graph API Permissions​

  • Go to API Permissions
  • Add:
    • Sites.Read.All
    • Sites.ReadWrite.All
Required Permissions

Missing or incorrect Graph API permissions will prevent your agents from interacting with SharePoint.

Step 3: Store Your Credentials in Vault​

  1. Go to SmythOS Vault
  2. Create a new secret for Client ID and Client Secret
    • Name them something like sharepoint_client_id, sharepoint_client_secret

Component Reference​

Get Root Site​

Retrieves your tenant’s root SharePoint site.

Inputs​

FieldRequiredDescription
tenant-namerequiredMicrosoft 365 tenant name.

Outputs​

FieldDescription
idRoot site ID
displayNameFriendly name of the site
nameInternal SharePoint site name
response, headersRaw API output and metadata
Get Root Site Inputs
Use Case
Start all SharePoint document operations by determining the root site ID.

Search Site​

Query team sites using keywords.

Inputs​

FieldRequiredDescription
queryrequiredName or keyword for the site you're searching for.

Outputs​

FieldDescription
valueMatching site(s) metadata
response, headersRaw API output and metadata
Search Site Input
Token Errors

Use the "Sign Out" → "Authenticate" cycle when tokens expire or become invalid.

List All Sites​

Lists all sites under the authenticated tenant.

Inputs​

FieldRequiredDescription
triggerrequiredTrigger flag to initiate fetch.

Outputs​

FieldDescription
sitesArray of SharePoint site objects
response, headersRaw API response
All Sites Output
TIP

Use this to populate dropdowns or enable conditional logic based on selected site.

List Site Drive Items​

Lists folders/files from the root directory of a SharePoint site.

Inputs​

FieldRequiredDescription
site_idrequiredSharePoint site ID from which to list contents.

Outputs​

FieldDescription
itemsArray of files/folders
response, headersFull API response
Drive Items Output
Missing Site ID

Always run Get Root Site or Search Site to obtain a valid site_id before using this component.

Best Practices & Tips​

  • Always store credentials using Vault.
  • Use Search Site before referencing team-specific drives.
  • Handle token refresh using "Sign Out" → "Authenticate" cycle.
  • Paginate List Site Drive Items if result set exceeds 200 items.
  • Secure Graph API access with least privilege scopes.

Troubleshooting​

ErrorCauseSolution
401 UnauthorizedExpired or missing tokenRe-authenticate using the sign-out flow.
403 ForbiddenPermission scope not setConfirm Sites.Read.All is granted/admin-consented.
Invalid site_idMissing or incorrect siteUse Search Site or Get Root Site to get a valid ID.
SharePoint integration diagram

What’s Next?​

Explore these automation ideas:

  • Sync weekly folders from SharePoint to Google Drive.
  • Let users search across SharePoint team sites and preview results.
  • Route uploaded files for processing (e.g., OCR, tagging).