搜索/过滤OneNote内容会出现错误" OData语法错误"

时间:2016-09-19 13:21:43

标签: onenote onenote-api

我想在OneNote API中的多个页面中搜索data-tag="to-do"。我通过curl使用以下代码与头文件中的Access toke -

$url = "https://www.onenote.com/api/v1.0/me/notes";
$url .= "/pages?filter=data-tag%20eq%20'to-do'";

但它给了我这个错误 -

{
  "error":{
    "code":"20128","message":"OData Syntax error at position 5 in 'data-tag eq 'to-do''.","@api.url":"http://aka.ms/onenote-errors#C20128"
  }
}

任何人都可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:0)

data-tag不是您可以在页面实体中过滤的字段,因此$ filter不起作用。您可以尝试通过?search = [YOURSEARCHSTRING]搜索页面内容(全文搜索)。但是,全文搜索不是过滤某些类型的页面内容的正确方法,例如数据标记。

我鼓励您在我们的uservoice中为我们输入一个项目,因为没有直接的方式来搜索此内容(除了查询每个页面并解析其结果)

https://onenote.uservoice.com/forums/245490-onenote-developer-apis

相关问题