Permission & Access Issues

Fix OneDrive for Business API Access Denied Errors

Aamir Naveed AkramAamir Naveed Akram Nov 25, 2026 868 views

Question details

Identify the app registration, permissions, consent, and authentication settings needed to access OneDrive for Business through an API.

How to Fix OneDrive for Business API Access Denied Errors
Product
OneDrive for Business API and Microsoft Entra ID
Device & OS
not provided
Scenario
An application registered in Azure AD completes OAuth authentication and then calls the Office 365 discovery API.
Observed behavior
The discovery API returns an Access Denied error after authentication.
Before you start

Identify the tenant, account type, API endpoint, OAuth flow, and exact error response used by the application. Check whether the application uses the legacy Office 365 discovery API or Microsoft Graph.

Solution 1Recommended

Check App Registration, Permissions, and Tenant Consent

Use this approach to verify that the registered app and access token are authorized for the API being called.

1
Review the app registration

In the Microsoft Entra admin center, open Identity > Applications > App registrations, select the application, and check its supported account types and tenant configuration.

2
Check API permissions

Open API permissions in the app registration and confirm that the permissions match the target API and authentication flow. For Microsoft Graph, a delegated flow might use Files.Read; an app-only flow requires an appropriate application permission, such as Files.Read.All.

3
Verify tenant consent

On the API permissions page, check the consent status. If admin consent is required, ask a tenant administrator to select Grant admin consent after reviewing the requested permissions.

4
Inspect the access token

Inspect the token claims and confirm that the audience identifies the API being called and that the delegated scopes or application roles include the required permissions. Never share the token when requesting help.

5
Retry the API request

Acquire a new access token after any permission or consent changes, then retry the API request and record its HTTP status, error code, and correlation ID if it still fails.

Check App Registration, Permissions, and Tenant Consent
Use the correct resource: Permissions and tokens for Microsoft Graph do not automatically authorize calls to a different API. The target API, token audience, and granted permissions must match.
Free Microsoft Office alternative

Work With Office Files in WPS Office

WPS Office is a free, lightweight alternative for editing documents, spreadsheets, and presentations. Its familiar interface and Microsoft Office format support make it easy to move existing files, though it does not fix OneDrive API authorization errors.

Open and edit Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTX.Use a familiar interface for everyday Office tasks.Work with Office files independently of troubleshooting the OneDrive API.Move existing Office files into a lightweight suite.
microsoft office alternative - wps office

Frequently Asked Questions

Why does the API deny access after OAuth sign-in succeeds?

Successful sign-in does not guarantee authorization for an API. Check the app's API permissions, tenant consent, token audience, and delegated scopes or application roles in Microsoft Entra ID.

Where do I grant consent for OneDrive API permissions?

In the Microsoft Entra admin center, open Identity > Applications > App registrations, select the app, and open API permissions. A tenant administrator can grant admin consent there when required.

Can I use a Microsoft Graph token with the Office 365 discovery API?

Not automatically. The access token's audience must match the API being called, and the app must have the permissions required by that API.

Which Microsoft Graph endpoint should I use for a user's OneDrive?

For a delegated request by a signed-in user, use GET /me/drive. For an app-only request, use an endpoint such as GET /users/{id}/drive with appropriate application permissions and admin consent.

What should I include in a developer support request?

Include the endpoint, HTTP status, error code, correlation ID, tenant type, authentication flow, and permission configuration. Do not post access tokens, client secrets, or other sensitive information.