MS Graph API获取OneNote页面结果不实时问题及替代API尝试
OneNote API Issues: Stale Data & Deprecated API Authentication Problems
Microsoft Graph OneNote API Stale Data Problem
- When calling
GET https://graph.microsoft.com/v1.0/me/onenote/sections/{ID}/pages?$top=100&$orderby=createdDateTime%20desc, results aren't real-time:- The section should contain 4 pages, but only 2 existing pages are returned.
- Pages deleted via
DELETE https://graph.microsoft.com/v1.0/me/onenote/pages/{ID}still appear in the response. - Retrieving HTML content for these deleted pages returns a 404 error.
- Resolutions:
- Allow time for Graph API sync (latency typically ranges from seconds to a few minutes).
- Filter out inactive pages by adding
$filter=status eq 'active'to your query string. - Disable any local caching in your application that might be serving stale data.
- Confirm the DELETE operation succeeded: check for a 204 No Content response and verify the page is removed from the OneNote desktop/mobile client.
Deprecated OneNote API (Scheduled for Nov 2022 Shutdown) Issues
- Outdated Documentation: The Microsoft Account Developer Center referenced in old docs now redirects to Azure Portal.
- Missing Permission: The
office.onenote_updatepermission noted in docs doesn't exist; only Microsoft Graph/OneNote permissions are available. - Authentication Errors: After adding
Notes.ReadWritepermission and re-authenticating:GET https://www.onenote.com/api/v1.0/me/notes/sections/{ID}/pages?$top=100&$orderby=createdDateTime%20descreturns 401 Unauthorized.GET https://www.onenote.com/api/v1.0/notebooksreturns 401 Unauthorized.GET https://www.onenote.com/api/v1.0/me/notebooksreturns 404 Not Found.
- Resolutions:
- Migrate fully to Microsoft Graph API since the deprecated OneNote API is no longer supported.
- If temporary use is necessary:
- Use Azure AD OAuth 2.0 endpoints for authentication (replacing the outdated dev center).
- Validate your access token includes the
Notes.ReadWritescope (use a token decoder tool to inspect claims). - Adjust endpoint paths: the
meprefix may not be valid for the deprecated API; try removing it for notebook/section queries.
内容的提问来源于stack exchange,提问作者Sean DeNigris
相关产品推荐
相关产品推荐

