0
votes

I can't get Inbox messages to return when querying for "me/messages" via the C# nuget client but I can get messages from other folders.

client.Me.Messages.Request().Filter("createdDateTime gt 2017-08-01T15:50:36.00Z").OrderBy("createdDateTime").Expand("attachments").GetAsync()

For some reason this returns only messages from the "Sent Items", "Deleted Items" and "Conversations" folders. But I don't get anything from the Inbox folder.

What's weird is that I can query for the list of folders and expand Messages for each folder and there are messages appearing for the Inbox.

IUserMailFoldersCollectionPage foldersPage = await client.Me.MailFolders.Request().Expand("messages").GetAsync();

So how come the messages appear on the folder object for the Inbox but not when I query "me/messages"?

1

1 Answers

1
votes

According to your descriptions, I suppose you want to get the messages in the inbox folder by using the API:

GET /users/{Garth-id | Garth-userPrincipalName}/messages.

Base on my test, it will get all the messages in the signed-in user's mailbox. According to this document, The default page size for this request is 10 messages.

We can get the parentFolderId from the response, and then we can use the parentFolderId to request this API: GET /users/{Garth-id | Garth-userPrincipalName}/mailFolders/{id} for getting the folder name.

There are two steps to check it whether the messages in the inbox folder will back.

1.We can increase the page size to get more messages, and please follow he code below:

var collectionMessagePage = await _serviceClient.Me.Messages.Request().Top(20).GetAsync();
  1. We can get the folder id in the response, and use the Folder ID to compare with the ID of the inbox.