I am trying to retrieve unread emails order by ascending from a sub folder of Inbox folder with below
URI
Attempt 1
https://outlook.office.com/api/v2.0/me/MailFolders/AAMkADBjMGZiZGFAAB4xqMmAAA=/messages?$count=true&$filter=isread%20eq%20false&$orderby=DateTimeReceived+asc
Result - StatusCode: 400 - Bad request
Attempt 2
https://outlook.office.com/api/v2.0/me/MailFolders/AAMkADBjMGZiZGFAAB4xqMmAAA=/messages?$count=true&$filter=isread%20eq%20false&$orderby=DateTimeReceived%20asc
Result - StatusCode: 400 - Bad request
If I try with Web API v1.0 orderby is working.
URI with v1.0
https://outlook.office365.com/api/v1.0/me/folders/AAMkADB4xqMmAAA=/messages?$count=true&$filter=isread%20eq%20false&$orderby=DateTimeReceived%20asc
https://outlook.office365.com/api/v1.0/me/folders/AAMkADBB4xqMmAAA=/messages?$count=true&$filter=isread%20eq%20false&$orderby=DateTimeReceived+asc
Could anyone advise what I'm doing wrong here with v2.0 which results in bad request.
In v2.0, DateTimeReceived
changed to ReceivedDateTime
.