无法过滤 userRole 上的笔记本

Unable to filter notebooks on userRole

我正在尝试获取我拥有的笔记本列表,我的 API 调用是: /me/notes/notebooks?filter=userRole eq 'Owner'(使用 API 控制台,因此不替换此处的空格)

响应包括

400 (Bad Request) The OData query is invalid. A binary operator with incompatible types was detected. Found operand types 'Microsoft.OneNote.Api.UserRole' and 'Edm.String' for operator kind 'Equal'

没有 userRole 过滤器周围的引号,我们得到:

400 (Bad Request) Unknown property name: 'Owner' /me/notes/notebooks?filter=userRole eq Owner

是否有正确的过滤 userRole 的方法?

编辑:

抓着救命稻草,但我也踩过

/me/notes/notebooks?filter=userRole eq Microsoft.OneNote.Api.UserRole.Owner

未成功...

{
  "error": {
    "code": "20143",
    "message": "The OData query is invalid. The child type 'Microsoft.OneNote.Api.UserRole.Owner' in a cast was not an entity type. Casts can only be performed on entity types.",
    "@api.url": "http://aka.ms/onenote-errors#C20143"
  }
}

我认为白色 space 字符可能会导致此问题。

试试这个;

filter=userRole%20eq%20'Owner'

me/notes/notebooks?$filter=userRole%20eq%20Microsoft.OneNote.Api.UserRole%27Reader%27

有效!