Forum Discussion
priyasheth
May 23, 2024Copper Contributor
Microsoft Graph API using for external user
We have been working with the Microsoft Graph API to fetch the mail list of an external user using the following endpoint: https://graph.microsoft.com/v1.0/me/messages. However, we are encountering an issue with the response returned by the API. The response is as follows:
stdClass Object ( [@odata.context] => https://graph.microsoft.com/v1.0/$metadata#users('4e75df4a-021c-457d-a7b4-8bcabaae1cbb')/messages [value] => Array ( ) )
As you can see, the response does not include any list of mails. The value array is empty.
Could you please provide guidance on why this might be happening?
- Guest cannot have a mailbox within the resource tenant, thus no messages will be returned. If you want to fetch messages in the user's actual mailbox in his home tenant, your application must be added therein and you should obtain a token for the user with audience set to the home tenant.