cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jclewis
Level: Powered On

Getting OneNote Page Content using Page Id results in 404 Not Found

I have a Flow that uses the OneNote Get Page Content Action to retrieve the body of a OneNote page. The Action uses the OneNote Page Id as a custom value. I supply the Notebook Key and the Notebook Section during design (selected from the pick-list), then supply the custom value using a lookup from an Excel table holding the Page Ids. This has worked up until about a week ago when it started failing. Now the Flow is producing a 404 Not Found.

 

I created a very simplified flow for testing purposes to demonstrate what I'm trying to do. Here I just supply the Page Id as a string variable. 

GetPageContent.png

 

This errors out with NotFound and outputs status code 404.

 

I can use the Get Pages for a Specific Section Action to retrieve the keys and compare them against my string input.

 

I have even created a simple Flow for testing purposes that looks at each Page Id resulting from the Get Pages Action and tries to call the Get Page Action - passing in the Page Id directly from the Apply to Each value from Get Pages. This still results in a NotFound status code 404. The goal was to pass the object directly instead of passing a string variable - in case I had a typo or some extra padding in the string. Still no success. At this point, I have no way of passing a custom value to the OneNote Get Page Action.

 

Question: How can I programatically pass the Page Id as a custom value to the OneNote Get Page Action?

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
knikolov
Level: Power Up

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

I think I figured it out....

 

I saw in the documentation (known issues and limitations section) the following text:

Notebook section. If you want to provide a custom value for the Notebook Section parameter, please specify it in the API URL format. The api url pattern:https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{siteCollectionsId}/sites/{SiteId}/n...}

 

Which made me think that they have changed the format of the PageId value as well.

I tested with the "contentUrl" property returned from the activity that lists all pages in a section. It DID WORK Smiley Very Happy Smiley Very Happy Smiley Very Happy

It is in this format if you need to compose it manually:
https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{SiteCollectionId}/notes/pages/{PageID}/content

 

Here is screenshot of my flow: https://imge.to/i/mwlWw

 

 

 

 

8 REPLIES 8
Community Support Team
Community Support Team

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

Hi @jclewis,

 

The error is 404 not found means the OneNote Page hasn't exist, may be some user have changed the page in the OneNote, you can confirm the page id whether correct.

 

If the page id is correct, you can recreate the connection of OneNote, then try it again.Annotation 2019-08-12 111913.png

 

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.

hochman
Level: Powered On

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

Hi @v-litu-msft,

 

I am having exactly the same problem as @jclewis  is having.

 

My flow iterates through all sections and picks the current month based on the name of the section (MMMM YYYY format).

 

After "selecting" current month, I get all pages under that section.

 

Then I iterate through all pages (under the current month section) to find the current daily page (14 August 2019 / DD MMMM YYYY format). As soon as I find the page, I get the page ID to get its content.

 

This flow was working 100% for months till last week when the last step, where it tries to get the page by page ID fails.

 

Now I had to create another flow that does the same but every day I have to manually point to the latest page to run my flow.

 

Can someone please have a look and see why this is happening?

 

Thanks!

 

 

 

 

jclewis
Level: Powered On

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

Thank you for the suggestion of refreshing the connection. I removed the existing connection and added a new connection to OneNote to make sure things were working properly. Unfortunately, this did not fix the problem.

 

I put together a test to see if the Page Id was being properly passed to the OneNote Get Page Action. As you can see here, I was able to use the One Note Get Section Action to process all PageIds directly into the OneNote Get Page Action - this still results in a 404 error. Since this was working a few weeks ago, it would seem something is malfunctioning in the OneNote Get Page Action now.

 

OneNoteTest.png

 

What's interesting about this test is that it clearly matches on the PageId using the Get Section Action, but not with the Get Page Action. I know this because the condition is met and the match on PageId is working, yet the One Note Get Page Action still yields a 404 for the match condition. As you can see, I'm passing the exact parameter into both Actions. Get Section yelds True, yet Get Page yields 404.

 

Am I missing something here?

jclewis
Level: Powered On

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

Hi @hochman, sorry to see you are having the same issue. I've had to add manual workarounds to my production flows to get around this problem. Hope we can figure it out soon.

knikolov
Level: Power Up

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

I have the very same problem.

I have one flow that gets all pages in a section and then tries to find the one generated today. It uses the Id returned by the "List Pages in section" activity to load the content. https://imge.to/i/OyeH4

It failes consistently since 1sf of August. 

 

Is this a regression and when is expected to be fixed?

Highlighted
knikolov
Level: Power Up

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

I think I figured it out....

 

I saw in the documentation (known issues and limitations section) the following text:

Notebook section. If you want to provide a custom value for the Notebook Section parameter, please specify it in the API URL format. The api url pattern:https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{siteCollectionsId}/sites/{SiteId}/n...}

 

Which made me think that they have changed the format of the PageId value as well.

I tested with the "contentUrl" property returned from the activity that lists all pages in a section. It DID WORK Smiley Very Happy Smiley Very Happy Smiley Very Happy

It is in this format if you need to compose it manually:
https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{SiteCollectionId}/notes/pages/{PageID}/content

 

Here is screenshot of my flow: https://imge.to/i/mwlWw

 

 

 

 

hochman
Level: Powered On

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

Hi @knikolov , you are a LEGEND!!!!

 

I have just updated my flows and now everything is working fine!!!

 

Thanks a lot for digging into it and discovering how to fix the issue!!!

 

I owe you a few beers!!! Smiley Happy 

jclewis
Level: Powered On

Re: Getting OneNote Page Content using Page Id results in 404 Not Found

I confirmed this with Microsoft support. Around the 1st of August, the format for supplying the Page Id changed from this:

 

1-88fe844e637c4ba88d3723cdedf50d06!192-e832c73a-5397-43f7-9ed7-f640cc572751
 
to:
 
https://www.onenote.com/api/v1.0/myOrganization/siteCollections/{SiteCollectionId/notes/pages/1-88fe844e637c4ba88d3723cdedf50d06!192-e832c73a-5397-43f7-9ed7-f640cc572751/content
 
Since this was a breaking change, it would have been nice to read about it in change notes or on the Flow blog. Perhaps I'm just not aware of how these changes are communicated.
 
Thanks for posting the answer @knikolov

Helpful resources

Announcements
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 50 members 4,948 guests
Please welcome our newest community members: