13,728 questions
Hi Marcelin,
To access an email from inbox there are couple things need to be done.
Steps
- Register an application - To be able to authenticate with the Microsoft identity platform and get an access token for Microsoft Graph, you will need to create an application registration. You can register it manually using Azure portal or powershell. Refer this page for more details (https://learn.microsoft.com/en-us/openapi/kiota/tutorials/php-azure?tabs=portal#register-an-application). You will also need to add additional API permission for MS Graph - Mail.ReadWrite because you need it to access the email messages.
- Next, you create the PHP application. Use Microsoft Kiota library for easy implementation accessing the MS Graph API endpoints. Refer this sample https://learn.microsoft.com/en-us/openapi/kiota/tutorials/php-azure?tabs=portal#create-the-client-application For full sample code using Microsoft Kiota refer to https://github.com/microsoft/kiota-samples/tree/main/get-started/azure-auth/php
- To get more information about Mail folders endpoints, refer to this page https://learn.microsoft.com/en-us/graph/api/resources/mailfolder?view=graph-rest-1.0
Hope this helps.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".