To integrate with Microsoft, the Microsoft Graph API is used. Configuration is required on the Azure platform.
Microsoft Graph API
Microsoft Graph API is used to integrate from Salesforce to Microsoft.
Microsoft Graph API is a unified endpoint provided by Microsoft that enables developers to access and manage data and resources across Microsoft 365 services (such as Teams) programmatically, allowing for integration, automation, and enhanced application functionality within the Microsoft ecosystem.
The Microsoft Graph API v1.0 documentation is found at https://learn.microsoft.com/en-us/graph/overview?context=graph%2Fapi%2F1.0&view=graph-rest-1.0. Microsoft's documentation is regularly updated. Please refer to the official Microsoft Graph documentation for the most current information.
The main resource types that are used in the integration include:
user -> https://learn.microsoft.com/en-us/graph/api/resources/user?view=graph-rest-1.0
event -> https://learn.microsoft.com/en-us/graph/api/resources/event?view=graph-rest-1.0
onlineMeeting -> https://learn.microsoft.com/en-us/graph/api/resources/onlinemeeting?view=graph-rest-1.0
virtualEventWebinar-> https://learn.microsoft.com/en-us/graph/api/resources/virtualEventWebinar?view=graph-rest-1.0
chat -> https://learn.microsoft.com/en-us/graph/api/resources/chat?view=graph-rest-1.0
Each resource has methods. Each method has permissions. There are three permission types namely:
Delegated (work or school account)
-
Delegated (personal Microsoft account)
This is not considered
Application
Whether to use delegated or application permissions depends on the authentication mechanism.
For Meetings, we advocate using server to server authentication which requires Application permissions.
For Webinars, a hybrid approach is required as some of the APIs only support delegated permissions. When the running user is a site guest user, server-to-server authentication is required. When the callout accesses the underlying online meeting, and we can pass the organizer id in the request, application permissions are used.
Microsoft Application
A Microsoft application needs to be registered on a Microsoft tenant. This is done by logging in to https://portal.azure.com . The logged in user must have rights to manage apps and assign permissions.
Manage Microsoft Entra Id
Once logged in, view Microsoft Entra Id. Make a note of:
-
Tenant Id
This is found on the 'Overview' blade of your Microsoft Entra ID.
This will be needed for URLs when defining the named credential.
App Registrations
A Microsoft app registration is a configuration in Azure Active Directory that establishes a unique identity for an application. This serves as a prerequisite for integrating Salesforce with Microsoft services. When an app is registered, it creates a set of credentials (Application (client) ID and client secret) that allows the Salesforce application to authenticate and obtain access tokens. This enables secure communication between Salesforce and the Microsoft platform. The registration defines the application’s permissions, authentication methods and access scopes.
Register an Application
From EventSpark Version 3.10, there is support for Teams integration for both meetings and webinars. Prior to this, only meetings were supported. There is a common subset of permissions needed for integration with both meetings and webinars. For webinars, there are additional delegated permissions.
Two of three AI tools recommend having only one application with all permissions to support both meetings and webinars. Each org can determine if for integration between EventSpark on Salesforce and Microsoft Graph on their Azure tenant, they want to use one App registration only or if they want to have separate apps for meetings and webinars.
This documentation defines one app only, but indicates which permissions are needed for meetings and which are needed for webinars.
You will need an application to support calling Microsoft Graph APIs from Salesforce.
Register an Application for EventSpark Integration with Teams
-
Go to App registrations
Click New registration
Name your application e.g. EventSpark Teams
-
Check Accounts in this organizational directory
-
This assumes all Microsoft users who are online meeting organizers are defined to this organizational directory
-
-
Click “Register”
-
Make a note of the following:
-
Application (client) Id
-
-
Click Add a certificate or secret
-
Click “New client secret”
-
Make a note of the Value. This will be the last time this is visible to you. It needs to be used when defining a Salesforce Named Credential.
Configure Permissions
For the integration between Salesforce and Teams, the following application permissions are required:
Application Permissions For Meetings
EventSpark Function |
Permission |
Permission Type |
Description |
Create a Meeting |
User.ReadBasic.All |
Application |
Read all users' basic profiles. |
|
Calendars.ReadWrite |
Application |
Read and write calendars in all mailboxes. |
|
OnlineMeetings.ReadWrite.All |
Application |
Read and create online meetings. |
|
|
|
|
Update a Meeting |
Calendars.ReadWrite
|
Application |
Read and write calendars in all mailboxes. |
|
|
|
|
Add Participants |
OnlineMeetings.ReadWrite.All |
Application |
Read and create online meetings. |
|
|
|
|
Wrap Up |
ChatMessage.Read.All |
Application |
Read all chat messages. |
|
OnlineMeetingArtifact.Read.All |
Application |
Read online meeting artifacts e.g. recordings. |
Delegated Permissions
Offline_access
Application Permissions For Webinars
EventSpark Function |
Permission |
Permission Type |
Description |
Create a Webinar |
User.ReadBasic.All |
Application |
Read all users’ basic profiles |
|
User.Read |
Delegated |
Read user profile |
|
VirtualEvent.ReadWrite |
Delegated |
Read and write virtual events. Also used to list webinar sessions and publish webinar. |
|
OnlineMeetings.Read
|
Delegated |
Read user's online meetings. |
|
|
|
|
Update a Webinar |
VirtualEvent.ReadWrite |
Delegated |
Read and write virtual events. |
|
|
|
|
Add Registrations |
VirtualEventRegistration-Anon.ReadWrite.All |
Application |
Write anonymous user’s virtual event registration e.g. when running user is site guest |
|
VirtualEvent.Read.All
|
Application |
Read all user’s virtual events to get registrationId. Use the registrationId to get the underlying registration sessionId and the joinUrl. |
|
VirtualEvent.Read |
Delegated |
|
Cancel Registrations |
VirtualEvent.ReadWrite.All
|
Application |
Read all user’s virtual events to get registrationId. |
|
|
|
|
Manage Registrations |
VirtualEvent.Read
|
Delegated |
Used to get registrations and sessions for each registration. |
|
|
|
|
Wrap Up |
ChatMessage.Read.All |
Application |
Read all chat messages. |
|
OnlineMeetingArtifact.Read.All |
Application |
Read online meeting artifacts e.g. recordings. |
|
|
|
|
Maintain access |
Offline_access |
Delegated |
Allows the application to maintain user access to resources via long-lived refresh tokens. Without this scope, access tokens typically expire in about 90 minutes, requiring re-authentication. |
Configure Authentication
For the Salesforce Browser Flow External Credential, a Web Redirect URL must be configured in the Azure Registration App.
Navigate to the relevant Registration App
Select Authentication
Under Platform configurations Add a platform
Click Web
-
Under Redirect URIs
Specify the call back URI of the Salesforce Auth. Provider that is selected in the Interactive External Credential
Click Configure
Grand Admin Consent
Application access to online meetings
When utilizing server-to-server authentication (client credential flow) to create online meetings and designate a specific user as the organizer, direct application permissions (such as OnlineMeetings.ReadWrite.All) are by design intentionally restricted by Microsoft Graph for security purposes regarding user-specific actions.
Allow applications to access online meetings on behalf of a user
To enable your application to perform actions on behalf of a user—for instance, to create an online meeting with a specified organizer, add participants, or retrieve attendance reports—without requiring an interactive user login, an Application Access Policy is necessary. This policy explicitly grants your application the authority to access online meeting resources on behalf of specific, authorized users. This mechanism ensures granular control over which users' meetings your application can manage via server-to-server calls.
Further documentation on this mechanism is available at https://learn.microsoft.com/en-us/graph/cloud-communication-online-meeting-application-access-policy#allow-applications-to-access-online-meetings-on-behalf-of-a-user
Application Access Policy NB (User Needs Access To Run PowerShell Scripts on Local Machine, Run As Administrator )
An Application Access Policy is created and permission granted to it via PowerShell.
PowerShell must be run as an administrator. This assumes that you have the necessary permissions to install and import modules.
To Open Powershell
To open Windows PowerShell, you can use the Start menu, the Run dialog, or the Command Prompt. You can also use keyboard shortcuts.
Start menu
Open the Start menu
Type Windows PowerShell
Select Windows PowerShell
Select Open
Run dialog
Press the Windows key + R to open the Run dialog
Type powershell
Press OK or Ctrl + Shift + Enter
Command Prompt
Open the Command Prompt
Type powershell
Press Enter
Keyboard shortcuts
Press Windows + X, then select PowerShell
Press A
Press Ctrl + Shift + P to open a new PowerShell session outside of the ISE
Once in Powershell
-
Install the Microsoft Teams PowerShell module
Install-Module -Name MicrosoftTeams -Force -AllowClobber
-
Ensure that you have rights to run scripts in PowerShell.
Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser
-
Connect to Microsoft Teams
Import-Module MicrosoftTeams
Connect-MicrosoftTeams
-
Create an Access Policy
New-CsApplicationAccessPolicy -Identity EventSpark-Integration -AppIds "{app registration client id}" -Description "EventSpark Integration Access Policy"
-
Grant access to the Microsoft users who will be Meeting organizers for EventSpark Event/Functions that run on Teams
Grant-CsApplicationAccessPolicy -PolicyName EventSpark-Integration -Identity "{user object id}"