1
votes

I have a simple enough API request: https://graph.microsoft.com/v1.0/me/mailFolders/Inbox/messages?$filter=isRead eq false?$select=subject,body

But the returned JSON says "Invalid filter clause"

I've tried URL encoding (i.e. adding %20 for spaces): same result

1

1 Answers

0
votes

Apparently there is a typo here and that's the reason why this error occurs:

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 

Here is a valid 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