web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / API URL of the section...
Power Automate
Answered

API URL of the section pages (Onenote)

(0) ShareShare
ReportReport
Posted on by 4

I decided to try power automate as it seemed it would speed up processes.  Except it is not working and now I am trying to work out why.

I am using the template Copy flagged Office 365 Outlook emails to OneNote

 

In the onenote part i have selected the notebook

however, this app cannot find the notebook section -   It could not retrieve values because I have over 5000 Onenote items.

So can the required code be added somewhere manually to make this happen

If so what is the code and where does it get added.

 

Thanks

Bronwyn

Categories:
  • bhitchlockfcs Profile Picture
    144 on at

    Hi @Bronwyn ,

     

    It appears the Section Pages url follows a format similar to below.  

     

    To find the API URL of the section you can try the following:

     

    1. Create a manual (button) flow with the action "Get Sections In Notebook"

    ONOTE_GetSections.png

    2. Run the Flow and view the results.

    ONOTE_GetSections_out.png

    3. Copy the Output into a text editor (I use VS Code) but anything with a Find function will work.

    4. Search for the name of the section you are looking for. Above the name you will see a "self" property. This is most of the API URL is beside the "self" label.

    5. To use this in your flow select "Enter Custom Value" and copy the entire URL adding  "/pages" to the end.

    onote_sectionapiurl.png

     

    I tested and it worked for me.

     

    Hope this helps!

     

    Brian

  • v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Bronwyn,

     

    @bhitchlockfcs 's advice is correct, please have a try, if it does not work, please contact us again.

     

    If your problem has been solved, You could go ahead and mark the post as solved by clicking “Accept as Solution” so that this thread will be marked for other users to easily identify!

    Best Regards,
    Community Support Team _ Lin Tu

     

  • Bronwyn Profile Picture
    4 on at

    i was going to reply to Brian, but you are current.

    I have started to follow Brian's advice, it took me a long time to find how to create a button.

     

    I do not have the same sequence that he highlighted in the code i have the following

     

    {
    "error": {
    "code": "10008",
    "message": "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/",
    }
    }
     
    Is there are work around for this?
     
    Thanks
    Bronwyn
  • Verified answer
    v-litu-msft Profile Picture
    Microsoft Employee on at

    Hi @Bronwyn,

     

    The error is caused by executing against SharePoint document libraries that contain a large number of items.

    When working with SharePoint document libraries that contain a large number of items, the OneNote API service is subject to throttling measures implemented by SharePoint for the purposes of regulating resource usage. Under these circumstances, the user of the application may see an application-specific error. 

     

    If Notebooks Count is greater than 5,000, then you need to bring the notebook count in the document library to under 5,000. You can do this by moving some of your notebooks out of the document library to a different storage location (such as another user or group's OneDrive). You can also delete the notebooks that are not required anymore.

    After you have reduced the notebook count to under 5,000, rerun the tool to make sure the notebook count is less than 5,000. Ideally, you should keep this number below 5,000 so that you can have enough room to create new notebooks. If the notebook count in the document library crosses 5,000 again, you will start seeing the OneNote API failures and you will need to come back here and take the same remedial steps.

     

    Best Regards,
    Community Support Team _ Lin Tu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • Bronwyn Profile Picture
    4 on at

    hello and thank-you for replying

     

    I read the article and I understand these limitations as I have already experienced them at another time.  This article was dated 2016.

     

    Is there a work around to this problem.

     

    Thanks

    Bronwyn

  • bhitchlockfcs Profile Picture
    144 on at

    Hi @Bronwyn,

     

    I'm not aware of an easy way to find the API Url for a section within the Flow. Possibly by querying the API directly with the addition of filters, but that's a complicated resolution.

    The best resolution would be those outlined in the link you shared.

     

    Is the Notebook located in a SharePoint library or Onedrive?

     

    The 5k section/document limit is best avoided in general with SharePoint. If you can move the Notebook to it's own library or create a new Notebook that will be the best solution. 

     

    Sorry I cannot offer more assistance.

     

     

     

    Sorry, I cannot be of more help.

  • ademirtjis Profile Picture
    2 on at

    i tried to get the API URL using the solution mentioned by bhitchlockfcs above. When i run the script to get the list of pages in a section i get this totally vague error

     
     
    Error Action 'Get_sections_in_notebook' failed
    Error Details
    Error; unknown error code encountered when attempting to retrieve the site Id for the supplied notebook. Code: 40001
     
    Any idea what this could refer to? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 345 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard