0

I tried to engage with the API team via Twitter but I've not had a response and development is grinding to a halt here...

In short I keep getting a 429 when developing against the OneNote API, I know that this suggests I'm hitting the API too hard, but I'm not.

At worst I'm doing maybe 1 or 2 requests per minute, manually invoked by me as I develop. Sometimes I'll leave it 10-15 minutes between calls, sometimes this works, sometimes not.

I've been working on a particular problem the last few days. In my code I make a call to get all notebooks, sections & section groups in a single query (filtered to only return data from certain notebooks)

I then make a second call to get all updated pages for those notebooks. I've been fiddling with the filter string to get this second call working (which I now think I have), but 9 times out of 10 I get the 429 on this second API call.

Is there some way of getting my user account whitelisted please?

FWIW this is my second query (the spaces normally get encoded):

/me/notes/pages?count=true&top=100&expand=parentNotebook,parentSection
&filter=(parentNotebook/id eq '{GUID}' or parentNotebook/id eq '{GUID}' or parentNotebook/id eq '{GUID}') and lastModifiedTime gt 2016-08-05T11:34:09.000Z

This does work as I'd expect, the date clause is working now, but I can only test very occasionally as I get the 429.

Incidentally if I run my second filter through the API console I get a 504 "Proxy request timeout", every time. This has been since I've added the parenthesis around the notebook predicate.

So I'm pretty much unable to continue development, how do I resolve this please?

4

3 回答 3

0

作为短期解决方法,请尝试以下方法:

而不是一个查询:

/me/notes/pages?count=true&top=100&expand=parentNotebook,parentSection&filter=(parentNotebook/id eq '{GUID}' or parentNotebook/id eq '{GUID}' or parentNotebook/id eq '{GUID}') and lastModifiedTime gt 2016-08-05T11:34:09.000Z

去掉“count=true”(你在用这个吗?),只留下一个 parentNotebookId 过滤器。结果将默认按 LastModifiedTime 降序排列(最近的在前)。

Perform this query for all the notebooks you're interested in:
/me/notes/pages?top=100&expand=parentNotebook,parentSection&filter=parentNotebook/id eq '{GUID}'
于 2016-08-09T21:36:13.577 回答
0

不幸的是,您在我们的 GET Pages API 中遇到了一个严重错误(当使用过滤器和其他查询参数调用时)。实际上,在调用我们的索引服务时,我们在应用过滤器方面做得很糟糕(这反过来又限制了我们)。我们已将此确定为一个持续存在的问题,该问题开始限制调用者,尤其是在负载较重的情况下。

短期解决方法:我们正在调整我们的容量并临时提高我们的合作伙伴索引服务设置的限制,同时我们进行长期修复。希望这将为您带来更少的 429。

作为面向未来的解决方案,我还鼓励您查看@Jorge 建议的答案。(删除 count=true 查询参数并仅在 1 个 parentNotebookId 上过滤(无 lastModifiedTime 过滤)

于 2016-08-09T22:03:07.877 回答
0

只是预感:您可以尝试将第二个调用(用于获取更新的页面)拆分为单独的 http 请求(每个笔记本 ID 一个)吗?

此外,如果您想要更新通知,那么 webhook 可能是更好的选择。

最后为 Twitter 上的沉默道歉。

于 2016-08-05T14:45:00.977 回答