Reputation: 715
How can I access emails from all mailboxes within a domain using the Graph API?
I am currently trying, using the Graph Explorer, to get the properties from a certain email in a mailbox within my domain. The office account I am logged in on is an Admin account within this domain.
For example:
my user is [email protected]
and has the following permissions in Graph Mail.ReadWrite
.
I can successfully use the following query:
/v1.0/users/[email protected]/messages?$filter=internetMessageId eq '{id}'
But when i try:
/v1.0/users/[email protected]/messages?$filter=internetMessageId eq '{id}'
It returns a 403
exception.
Is there a problem with the permissions set or does the admin_user
not have enough rights over the mailbox for other_user
?
Upvotes: 1
Views: 170
Reputation: 33094
That is correct, Mail.ReadWrite
only provides access to the current user's mailbox. This is true even if they are an Admin.
The only way to get around this would be to use App-only (aka client_credentials
). This would allow your app to read/write any mailbox on the system. See Get access without a user.
Upvotes: 1