0

I am creating pages in OneNote using OneNote's REST API. For the most part, it works well. However, some pages never show up. According to their HTTP response code (201), they all POST correctly, but no matter when or how many times I run the program, some pages (always the same ones) never appear. Sometimes, if I wait a very long time (e.g. days), a page will finally show up, but usually it disappears again after a while.

Example: if I were to upload 10 pages, I might have 5 that appear in OneNote Online right away, 3 that appear after ten minutes, and 2 that never show up at all (no matter how much I sync), even though they all post to the same place, have unique names, and all return response 201.

If I send a GET request using the ids of the missing pages and include FavorDataRecency: true in the header, the API returns that no such page(s) exist. However, if I leave that header off, then the API returns that they exist as well as their information.

How can I get them to show up?

Update Note: If I delete the sections I'm uploading to and recreate them, then run my program, all the pages POST fine. I have yet to determine if they'll continue to post fine in subsequent runs. For now, it seems to me like something in the way OneNote indexes or caches the pages might be part of the problem. Thoughts?

Elliptica
  • 3,928
  • 3
  • 37
  • 68
  • If you open OneNote - are you sure these pages exist in the notebook? – Jorge Aguirre Jul 29 '16 at 18:20
  • 1
    That's where I'm looking when I'm referring to how many pages actually "show up". The notebook and section definitely exist. The POST responds that it creates the page successfully. Yet only a few of them will show up in OneNote itself. – Elliptica Jul 29 '16 at 18:31

1 Answers1

0

The symptoms described above:

  • POST succeeded
  • Pages do not show up in GET calls
  • Pages do not show up in OneNote

Imply that your pages did not actually succeed to be created - here are my asks/suggestions:

  1. Ask: Send us the value of the X-CorrelationId header on one of the POST page responses where this symptoms occur so we can debug this.
  2. Suggestion as improvement/temporary workaround: You can retry the POST calls after seeing the pages don't appear.
Jorge Aguirre
  • 2,787
  • 3
  • 20
  • 27
  • Sure. For 1), how do I get the X-CorrelationId? For 2), I have tried rerunning the POST, but the pages still never show. Oddly, I've even deleted the section and recreated it, then rerun the program. It worked then, but subsequent updates faced the same problem. (What I do is delete any pages in the section with the same name, and then create a new page with that name). Strangely, if I upload pages A,B,C,D, and C was the one not appearring in the original section, it's also the one not appearing in the new section (though it did when C did not exist at all). – Elliptica Jul 29 '16 at 21:57
  • 1) The X-CorrelationId is an HTTP header in the response we send back (the auth information you send is also in the headers) - how you get it depends on the language you are coding on. – Jorge Aguirre Aug 02 '16 at 18:11
  • 2) This hints towards a consistent failure on certain types of content. Having the X-CorrelationId will help us fix the problem. – Jorge Aguirre Aug 02 '16 at 18:12
  • So here is an example of the X-CorrelationId for one such page that claims to post but never appears. Its response code is 201. X-CorrelationId: ee04d0b6-5b62-4247-8c3b-b31a8ed27cb8 – Elliptica Aug 02 '16 at 20:49