OneNote API Issues affect Append/Prepend functionality

I spent a good chuck of time yesterday and today troubleshooting an issue with OneNote actions, only to determine the issue is at Microsoft’s end in the OneNote resources in the Microsoft Graph API which Drafts uses to integrate.

What people using OneNote integration need to know:

  • This issue does not affect actions which only create new pages in OneNote.
  • Actions which update existing pages - like those configured to append/prepend/replace - may be very unreliable at the moment. In some cases they will create a new page instead of appending, etc.

What is happening?

In order to update existing pages, Drafts has to query OneNote to find existing pages, get their current state, and construct the appropriate new information to send back to OneNote. Currently (starting at least a month ago, it seems), the methods in the OneNote API to get information about pages are returning very old information…sometimes days or more old. It will not return information about recently created pages, and will often include information about pages which no longer exist or have been moved.

Because of this, Drafts may get bad information about the state of your OneNote notebooks and not be able to find pages to update…or proceed to try to update pages which no longer exist, resulting in errors.

When did this start?

I don’t know exactly. It was drawn to my attention researching a support issue for a user who was seeing problems. Based on Googled-info, it’s been around at least a month. I know it used to work fine, so it is something that changed at Microsoft’s end.

Will Microsoft fix this?

Well, I certainly hope so. I’m working on trying to get to a technical contact or support entity that could help, but with a big company like Microsoft, that’s not that easy to do, especially if you are not inside a large corporation with MS support contracts. I will update with information when or if anything changes. It certainly seems like a big issue that must be causing trouble for some other people. I have found a few people reporting similar problems on Stack Overflow.

Technical Details

This section is primarily intended for anyone inside Microsoft who might read this post.

The specific issue is that API endpoints that return information about pages in OneNote seem to be working from cached information that is not getting updated properly when changes are made in a OneNote account.

To reproduce, you do not need an app, but can use the Microsoft Graph API Explorer. Steps:

  • Go to API Explorer, make a request for:
  • Open the same OneNote account in the app or web interface, make a number of changes to pages. Add some new ones, delete some, whatever.
  • Go back to API Explorer, make same request again:

A few notes:

  • Data will eventually get updated, but it may take days (or possibly weeks).
  • This same issue can be reproduced requesting pages of a specific section under it’s resource in the graph API.
  • This issue does not happen for other resources in the OneNote API. Changes to notebooks and sections, for example, are reflected immediately.
2 Likes

Yes!! I could not figure out why all my onenote actions would create sections or pages but then not be able to append or create new ones. I could delete the section in onenote and run the action again and it would work but not append or overwrite anything existing

Hi,

Do you know if this problem has been resolved yet or taken notice of by Microsoft?

Thanks,
Chris

As far as I know, still a problem. I did, via Twitter, reach the product manager for the Microsoft Graph API, and they are aware of the problem. I followed up with her several times - but its not something they have addressed. :man_shrugging:

I can confirm that this is still a problem.

I suppose a workaround for now would be to use the OneNote email service, albeit with its limitations. It seems that it can only save notes into the Default notebook (but you can specify a section). OneNote’s “Email Settings” page says:

Tip: You can also save your email to a different section in the default notebook by including the “@” symbol followed by the section name at the end of your email subject line.

It might look like this:

To: me@OneNote.com
Subject: @Trip Details

Hi there!
I am receiving error messages from both the onenote actions.
Is this a permanent issue?
The Log reports that the notebook does not exist.
Any idea on how to solve it?
Kind regards
RC

Are these actions that have worked for you in the past and stopped working, or have they never worked? First thing I would suggest is to forget your OneNote credentials and then re-run the action to authenticate. I’ve seen Microsoft invalidate credentials from time to time.

1 Like

Thank you so much!
Forgetting the credentials solved the issue.
The very same actions worked previously!
Greetings
RC

1 Like