Error: API Error While Getting SharePoint Folder
Issue
While setting up a connection, the Validating Shared URL from SharePoint setup test fails with the following error:
Validating shared URL from SharePoint: API error while getting SharePoint folder. Please reauthorize and check if URL is correctly copied. The request your Sharepoint connection sent to your Sharepoint source was invalid.
Environment
- Connector: SharePoint
- Authentication method: Customer-registered app - Client secret
Resolution
To resolve this issue:
In SharePoint, select the folder, then click Share > Copy link. Don't use the browser address bar or a link copied from an email or Microsoft Teams. Ensure the link doesn't point to an
AllItems.aspxpage.In Microsoft Entra ID, verify the app's Microsoft Graph permissions:
i. Ensure
Sites.Selectedis configured as an Application permission, not a Delegated permission.ii. Ensure an administrator has granted consent for the permission.
Grant the app access to the target SharePoint site using the Microsoft Graph
sites/{site_id}/permissionsendpoint. Changing the authentication method doesn't grant this access automatically.In the Fivetran connection setup form, re-enter the client secret value, not the secret ID.
Click Save & Test.
For more information, see our SharePoint Setup Guide.
Cause
This issue occurs when:
- The shared folder link is invalid or points to an
AllItems.aspxpage. - The app's Microsoft Graph permissions or admin consent are incomplete.
- The app hasn't been granted access to the target SharePoint site.
- You enter the client secret ID instead of the secret value.