Hi Arun Singh5,
Good day.
Thank you for posting to the Microsoft Community. We are glad to assist.
To call Microsoft Graph APIs from a JavaScript Outlook Add-In, you can follow these steps:
Register Your Application
First, you need to register your application in the Microsoft Entra admin center:
- Go to the Microsoft Entra admin center.
- Navigate to App registrations and select New registration.
- Fill in the required fields, such as the name and redirect URI (set it to a Single-page application (SPA) with a URL like
https://localhost:3000).
Configure API Permissions
- After registering, go to API permissions and add the necessary Microsoft Graph permissions, such as
Mail.ReadandMail.ReadWrite.
Set Up Authentication
- Use the Microsoft Authentication Library (MSAL.js) to handle authentication in your add-in.
- Install it via npm: npm install @azure/msal-browser
Get an Access Token
- Use MSAL.js to get an access token for Microsoft Graph:
Call Microsoft Graph API
- Use the access token to call Microsoft Graph API and download emails and attachments:
Integrate with Outlook Add-In
- Use the Office JavaScript API to integrate this functionality into your Outlook Add-In. For example:
This should help you get started with calling Microsoft Graph APIs from your JavaScript Outlook Add-In.
,
If you’re still need more details for this you can try contacting Get support - Microsoft 365 admin | Microsoft Learnthe support team will have access to assist remotely .
I hope this helps let me know if this is contrary to what you need, I would still be helpful to answer more of your questions .
Best Regards
Community Moderator