OneNote API calls fail with a large number of items in a SharePoint document library

Allura Clinics 6 Reputation points
2021-09-04T09:14:48.317+00:00

Hi there, I am getting the below response when I tried to fetch the Notebooks with offset queries

Note : Notebooks synced crossed 5k files & we are about to sync 23k files

When the totals notebooks count below 5k it worked well but now it's throwing below error - Please help me on this - How to resolve this

One or more of the document libraries on the user or group’s OneDrive contains more than 5,000 OneNote items (notebooks, sections, section groups) and cannot be queried using the API. Please make sure that none of the user or group’s document libraries contains more than 5,000 OneNote items. Browse to this page for more information: https://blogs.msdn.microsoft.com/onenotedev/2016/09/11/onenote-api-calls-fail-with-a-large-number-of-items-in-a-sharepoint-document-library/

I am stuck with this words (5,000 OneNote items (notebooks, sections, section groups)) from the response - It shouldn't include BY SECTIONS wise also?
in a folder...

I have created folders (subfolders) have not more than 5k files in each main folder based on this first comment (https://answers.microsoft.com/en-us/msoffice/forum/msoffice_onedrivefb-mso_other-mso_o365b/evernote-to-onenote-import-fails/cf762ba1-00b4-43bc-9856-ec1fba07449e?page=1) but no use

My Onedrive have the notebook files not in sharepoint - I don't have any files in sharepoint

Office Management
Office Management
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Management: The act or process of organizing, handling, directing or controlling something.
2,450 questions
OneDrive Management
OneDrive Management
OneDrive: A Microsoft file hosting and synchronization service.Management: The act or process of organizing, handling, directing or controlling something.
1,503 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Paul Varner 0 Reputation points
    2025-04-21T19:33:25.32+00:00

    I had a similar problem getting the following error message when I tried to "Send to OneNote" to save an email or meeting from Outlook to OneNote:

    "Error when expanding notebook. One or more of the document libraries on the user or group's OneDrive contains more than 5,000 OneNote items (notebooks, sections, section groups) and cannot be queried using the API. Please make sure that none of the user or group's document libraries contains more than 5,000 OneNote items. Browse to this page for more information: https://blogs.msdn.microsoft.com/onenotedev/2016/09/11/onenote-api-calls-fail-with-a-large-number-of-items-in-a-sharepoint-document-library/". 

    Since my company security policy did allow me run the Microsoft program to determine how many notes I had on OneNote repositories on SharePoint, I had to find another way to fix this error.

    After multiple Microsoft help tickets and multiple conference calls, I fixed my problem by moving all my documents / files from SharePoint-"My Documents" and SharePoint-"My Downloads" onto my local disk drive. Once the number of my files located on SharePoint was well below 2,000, I was able to "Send to OneNote" (emails and meetings) from Outlook to OneNote.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.