I am currently using Microsoft Graph API v1 to retrieve the list of messages present in a user's inbox and I have all the necessary scopes listed in order to read and write messages on behalf of the user, the scopes are
- openid,
- profile
- offline_access
- https://graph.microsoft.com/mail.read
- https://graph.microsoft.com/mail.readwrite
- https://graph.microsoft.com/mail.send
- https://graph.microsoft.com/user.read
When I make an api call to fetch all the messages from the mailFolderINBOXthrough the apilistMessagesAPI, I am getting the messages, but the api in itself doesn't return some mails even though I can see them in my Inbox folder in Outlook UI. Are there any other settings or parameter that I need to enable in order to get all the mails?
The receiver from whom I received the mail is in my SafeSender List and not in any Blocked List
Any suggestions or answer would be helpful
An example code of what I am doing is as follows
function getUserMessages() {
const baseUrl = "https://graph.microsoft.com/v1.0/me/mailFolders/inbox/messages";
return axios({
method: 'GET',
url: baseUrl,
headers:{
"Authorization": "Bearer <access_token>"
}
}).then((result) => result.data);
}
// Here in the messages I get, I don't see some of the mails which are
// present in the inbox Folder
const messages = getUserMessages();