Sync OnlineMeeting in Outlook Calendar

Anastasia ZAFEIROPOULOU 0 Reputation points
2023-07-10T10:34:42.3066667+00:00

I have created a meeting link using Microsoft API through Confidential Client Application and everything works well. I want for users to choose whether or not this meeting will be synced in their outlook calendar. Is there a way to take this meeting as it is and do that or do I need to also create PublicClientApplication? I am very confused
My logic is that I give the MeetingURL to a user and it's up to them whether or not they want the meeting to be synced in their calendar

Microsoft Security | Microsoft Graph
Microsoft Teams | Microsoft Teams for business | Other
{count} votes

1 answer

Sort by: Most helpful
  1. Azar 29,520 Reputation points MVP Volunteer Moderator
    2023-07-10T13:25:01.9466667+00:00

    Hi

    This is the general flow

    1. Request the necessary permissions: In your application, when acquiring an access token for the Microsoft Graph API, request the Calendars.ReadWrite or Calendars.ReadWrite.Shared delegated permission, depending on your requirements. These permissions will allow you to read and write calendar events on behalf of the user.
    2. Generate the meeting link: Using the Microsoft Graph API, create the meeting and generate the meeting link. You can provide this link to the user.
    3. User consent and calendar synchronization: When the user wants to sync the meeting to their Outlook calendar, you need to initiate the OAuth consent process to obtain the necessary permissions. For this, you can redirect the user to the Azure AD consent endpoint (https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/authorize) and include the appropriate parameters, such as the response_type, client_id, redirect_uri, scope, and state. Ensure that the scope includes the required calendar permissions (Calendars.ReadWrite or Calendars.ReadWrite.Shared).
    4. User authorization and callback: The user will be prompted to sign in and consent to the requested permissions. Upon successful consent, Azure AD will redirect the user back to the specified redirect_uri along with an authorization code.
    5. Obtain an access token: Exchange the authorization code for an access token and refresh token by making a request to the token endpoint (https://login.microsoftonline.com/{tenant-id}/oauth2/v2.0/token). Ensure that you include the required parameters, such as grant_type, client_id, redirect_uri, client_secret (if using a confidential client application), and the authorization code.
    6. Sync the meeting to the user's calendar: With the access token obtained in the previous step, use the Microsoft Graph API to create an event in the user's Outlook calendar. You can include the meeting details and the meeting link in the event.

    kindly accept the answer if its useful

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.