ms-graph到Outlook:收到错误“无效的过滤器子句”

时间:2019-08-09 14:23:09

标签: microsoft-graph

我有一个足够简单的API请求: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$ filter = isRead eq false?$ select = subject,body

但是返回的JSON显示“无效的过滤子句”

我尝试了URL编码(即为空格添加%20):相同的结果

1 个答案:

答案 0 :(得分:0)

显然这里有错字,这就是发生此错误的原因:

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false?$select=subject,body
                                                                                      ^
                                                               query options expects '&' instead of '?' as a delimiter 

这里是有效的OData URL

https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false&$select=subject,body
\_______________________________/\___________________________/ \__________________________________________/
                  |                               |                                  |
          service root URL                  resource path                  query options