Skip to main content
The StackOne File Picker provides a unified interface for browsing and selecting documents from third-party platforms. It abstracts provider-specific differences behind a consistent user experience and developer interface, whether the source is a file storage system (like SharePoint, OneDrive, Google Drive) or a knowledge base (like Confluence or Notion).

How it works

The File Picker allows users to:
  • Navigate a hierarchical file tree (folders, pages, blocks)
  • Select one or more files or documents
  • Return a list of StackOne file objects, which can be used with unified operations such as GET /unified/documents/files/{id} or POST /unified/documents/files/{id}/download

Picker types


Output Format

When a user completes selection, the picker returns:
Each fileId corresponds to a StackOne-normalized file object that can be accessed via API:
  • GET /unified/documents/files/{id} – fetch file metadata
  • POST /unified/documents/files/{id}/download – retrieve file contents (if supported)

File Object Structure (for Fetch)

When queried individually, a file returns the following structure:
  • For knowledge bases like Confluence and Notion:
    • Files may represent pages or blocks
    • Additional metadata like hasContent, hasChildren is provided

Developer Integration Example

  1. Trigger the Picker Use the StackOne SDK, embed directly via the UI component or trigger via the StackOne Dashboard.
  2. Receive Selection The picker will return:
  3. Perform Unified Actions
    • Fetch metadata: GET /unified/documents/files/{id}
    • Download file: POST /unified/documents/files/{id}/download

Provider feature table


Developer integration

  1. Trigger the Picker Use the StackOne SDK, embed directly via the UI component or trigger via the StackOne Dashboard.
  2. Receive Selection The picker will return:
  3. Perform Unified Actions
    • Fetch metadata: GET /unified/documents/files/{id}
    • Download file: POST /unified/documents/files/{id}/download

Auth & permissions

  • Each provider uses OAuth2 authentication via StackOne’s integration flow
  • File access scopes are handled per provider during authentication
    • SharePoint: Files.Read.All, Sites.Read.All
    • Google Drive: https://www.googleapis.com/auth/drive.readonly
    • Confluence/Notion: Read access to spaces/pages/blocks

StackOne File Picker SDK Documentation

The StackOne File Picker SDK enables you to integrate file selection from connected accounts into your application. Below are the installation steps, usage examples, and API details.

Installation

Install the SDK using one of the following package managers:

Connect Session Token

The File Picker requires creating a separate connect session token with the Account ID and Provider Key of a connected account.

Usage

Below you can find the basic usage of the StackOne File Picker SDK using React:

API Reference

File Picker Configuration Options

File Selection Response Format

When users complete their selection, the onFilesPicked callback receives different response formats depending on what was selected:
Folder Selection Handling: When folderSelectionEnabled: true is set, users can select entire folders. The response will include folder IDs in the selection. To retrieve all files within selected folders (including nested subfolders), use the List Files API with the folder_id parameter and nested_files: true option to automatically fetch all nested content.
Note: Only onFilesPicked is typically required for document management use cases. Other callbacks (onOpen, onClose, onCancel, onError) are optional and depend on specific user actions or error conditions.

Picker Output Format

When users complete their selection, the picker returns different formats based on what was selected and configured:

FilePicker Methods

method
Opens the file picker interface.
method
Closes the file picker interface.

Notion File Picker

StackOne’s custom picker for Notion provides a unified interface for browsing and selecting Notion content.

User flow

  1. Land on Workspaces page — The picker opens to a list of workspaces. The General Workspace represents the top-most level of the user’s Notion workspace.
  2. Search for content — Once inside the General Workspace, users search for a file or folder by name.
  3. Navigate and select — Users can navigate into folders to select sub-files/folders, or pick the folder/file directly from search results.

Characteristics

  • Files and Folders: Only databases and pages are returned as files and folders
  • Dual-Role Pages: A page can be both a file and folder depending on whether it has content or child pages/databases
  • Column List Traversal: If a page has blocks which are column lists, we traverse these blocks to find child pages and databases and return these as direct children
  • Actual Location: A file/folder will show in the actual location it resides in, not where it is linked in other files
  • Access Control: The customer must grant access to each page/database they want to appear in the file picker by going to Settings → Connections → Share with integration

Testing

You can test the File Picker directly in the StackOne dashboard to verify it’s working correctly with your connected accounts.

Accessing the File Picker test

  1. Navigate to Accounts in the StackOne dashboard
  2. Find the linked account you want to test
  3. Click the ellipsis menu (⋯) on the account row
  4. Select Test File Picker (or similar option)
This opens the File Picker interface for that account, allowing you to:
  • Verify the picker loads correctly
  • Test navigation through folders/drives
  • Confirm file selection works
  • Check that selected files return the expected format

Testing checklist

  • File Picker opens successfully
  • Navigation works (folders/drives expand and collapse)
  • Files are visible and selectable
  • Multi-file selection works (if enabled)
  • Selected files return correct StackOne unified IDs
  • Selected file IDs work with GET /unified/documents/files/{id}
  • Error handling works (test with invalid account or expired token)

Common issues

Possible causes:
  • Invalid or expired session token
  • Missing or incorrect account ID
  • Provider not properly connected
  • OAuth redirect URI misconfiguration
Solutions:
  1. Verify the account is connected and shows a healthy status
  2. Check that the connect session token was created with the correct accountId and provider parameters
  3. Ensure OAuth redirect URIs are properly configured (see OAuth Proxy Redirect)
  4. Check browser console for error messages
Possible causes:
  • Insufficient permissions/scopes
  • Account authentication expired
  • Provider-specific access restrictions
Solutions:
  1. Verify OAuth scopes are correctly configured:
    • SharePoint: Files.Read.All, Sites.Read.All
    • Google Drive: https://www.googleapis.com/auth/drive.readonly
    • Confluence/Notion: Read access to spaces/pages/blocks
  2. Re-authenticate the account if tokens have expired
  3. For Notion: Ensure pages/databases are shared with the integration (Settings → Connections → Share with integration)
  4. Check account status in the dashboard
Possible causes:
  • Provider-specific navigation differences
  • Custom picker behavior for knowledge bases (Confluence/Notion)
Solutions:
  1. Review provider-specific picker behavior:
    • Confluence/Notion: Pages can act as both files and folders
    • SharePoint: Requires site selection before drive/folder navigation
  2. Review the Picker Types and provider notes above
  3. Verify you’re testing with the correct provider type
Possible causes:
  • Using provider-specific IDs instead of StackOne unified IDs
  • Incorrect field selection in configuration
Solutions:
  1. Ensure you’re using the id field from the picker response (this is the StackOne unified ID)
  2. Use the unified ID with StackOne API endpoints: GET /unified/documents/files/{id}
  3. Don’t use provider-specific IDs directly with StackOne APIs
  4. See the Developer Integration output format above
Possible causes:
  • Redirect URI not configured in provider OAuth app
  • Redirect URI mismatch between configuration and actual URL
  • Missing redirect URI for File Picker (required for Google Drive, SharePoint, OneDrive)
Solutions:
  1. For Google Drive: Add File Picker redirect URI to your OAuth app configuration
  2. For SharePoint/OneDrive: Ensure redirect URI includes File Picker support
  3. See OAuth Proxy Redirect for detailed setup
  4. Verify redirect URIs match exactly (including protocol, domain, and path)

OAuth Proxy Redirect

Configure the redirect URIs the picker needs.

Documents Actions

The endpoints behind the files you select.

Error Codes

Documents error codes and troubleshooting.

Connector Guides

Provider setup for SharePoint, Google Drive, OneDrive, and Confluence.