OneDrive

Import files directly from your OneDrive account

Overview

PrimeLink can import files directly from your OneDrive account (both personal and business). This integration uses OAuth 2.0 authentication with Azure AD for secure access to your files.

You can import using either a file ID/share link (Fetch method) or browse your OneDrive files directly (Browse method with OAuth).

Prerequisites

OAuth Configuration

Before using OneDrive import, you need to configure OAuth credentials:

  1. Go to PrimeLink → Settings → Integrations
  2. Find the OneDrive section
  3. Enter Client ID, Client Secret, and Tenant ID
  4. Authorize PrimeLink to access your OneDrive
  5. Save settings

Setting Up OneDrive OAuth

  1. Go to Azure Portal
  2. Navigate to Azure Active DirectoryApp registrations
  3. Click New registration
  4. Enter app name (e.g., "PrimeLink OneDrive")
  5. Select supported account types:
    • Personal Microsoft accounts only - for personal OneDrive
    • Accounts in any organizational directory - for business OneDrive
  6. Set redirect URI: https://your-site.com/wp-admin/admin.php?page=mt-primelink-settings
  7. Click Register
  8. Copy the Application (client) ID
  9. Go to Certificates & secretsNew client secret
  10. Create a secret and copy it immediately (it won't be shown again)
  11. Go to API permissionsAdd a permission
  12. Select Microsoft GraphDelegated permissions
  13. Add permission: Files.Read or Files.ReadWrite
  14. Click Grant admin consent (for business accounts)
  15. Copy Tenant ID from Overview page
  16. Paste Client ID, Client Secret, and Tenant ID into PrimeLink Settings
  17. Authorize PrimeLink in the settings

How to Import from OneDrive

Step 1: Select OneDrive Option

In Step 2 of the import wizard:

  1. Find the Upload From OneDrive option
  2. Click to select it
  3. The OneDrive panel will appear

Step 2: Specify File

You can specify the file in two ways:

Method 1: Fetch (File ID/Share Link)

  1. Enter the file ID or share link in the input field
  2. Get file ID from OneDrive share link
  3. Click Fetch to download the file

Method 2: Browse (OAuth)

  1. Click the Browse button
  2. If not authorized, you'll be prompted to sign in
  3. Select your Microsoft account
  4. Grant permissions to PrimeLink
  5. Navigate to your file in OneDrive
  6. Select the file you want to import
  7. The file will be automatically fetched

Search Files

If search is available:

  1. Use the search input field
  2. Type file name or keywords
  3. Search results will appear
  4. Select the file from results

Step 3: Continue Import

Once the file is fetched:

  1. The file will be parsed automatically
  2. Columns/fields will be detected
  3. A preview of the data will be shown
  4. Click Next to proceed to Step 3

File ID and Share Links

File ID Format

OneDrive file IDs are long alphanumeric strings:

  • Example: 01ABC123DEF456GHI789
  • Found in the file's share link
  • Extract from OneDrive share URL

Share Link Format

You can use full OneDrive share links:

  • https://onedrive.live.com/redir?resid=FILE_ID
  • https://1drv.ms/x/s!FILE_ID
  • Or use the file ID directly

Personal vs Business OneDrive

Personal OneDrive

  • Use personal Microsoft account
  • Select "Personal Microsoft accounts only" in Azure AD
  • No admin consent required
  • Works with personal OneDrive files

Business OneDrive (OneDrive for Business)

  • Use organizational account
  • Select "Accounts in any organizational directory" in Azure AD
  • Admin consent may be required
  • Works with business OneDrive files
  • May require additional permissions from IT admin

Best Practices

  • Use OAuth for Browse: OAuth method is more convenient for browsing
  • Organize files: Keep import files in dedicated OneDrive folders
  • Use consistent naming: Name files clearly for easy identification
  • Test credentials: Verify OAuth works before setting up imports
  • Monitor file updates: Ensure files in OneDrive are current
  • Secure credentials: Keep OAuth credentials secure
  • Handle token refresh: OAuth tokens may expire - re-authorize if needed

Troubleshooting

OAuth Authorization Fails

  • Verify Client ID, Client Secret, and Tenant ID are correct
  • Check redirect URI matches Azure AD configuration
  • Ensure API permissions are configured correctly
  • For business accounts, verify admin consent is granted
  • Check account type matches Azure AD app registration

File Not Found

  • Verify file ID or share link is correct
  • Check file exists in your OneDrive
  • Use Browse to locate file if OAuth is configured
  • Verify file is accessible with current permissions

Fetch Fails

  • Check internet connection
  • Verify OneDrive API is accessible
  • Check file size isn't too large
  • Review error messages for details
  • Try using Browse method instead

Permission Errors

  • Verify Files.Read permission is added
  • Check admin consent is granted (for business accounts)
  • Re-authorize PrimeLink if token expired
  • Check file sharing permissions in OneDrive

Next Steps

☁️ Dropbox

Import files from Dropbox

Learn More →
☁️ Google Drive

Import files from Google Drive

Learn More →
🗺️ Field Mapping

Map your imported data to WooCommerce fields

Learn More →