Work with UserMappingService

The following are Apex classes for Slack userMapping.

Query for existing Slack User Mappings stored in Salesforce. These mappings are created when a Slack user connects one of the Salesforce apps to their Salesforce account. Additionally, admins can create these mappings using the Mass User Provisioning API. These mappings aren’t associated with any specific application. A user may have multiple mappings if they connect different Slack workspaces to Salesforce.

Usage

The following are methods for UserMappingService.

For a given Slack User ID, get the associated Salesforce User Id.

Signature

Parameters

slackUserId

Type: String

Return Value

Type: String

Given a list of Slack User IDs, get the associated Salesforce user ids. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Slack user ID.

Signature

Parameters

slackUserIds

Type: List<String>

Return Value

Type: Map<String, String>

Gets the Slack user ID for a given Salesforce ID within a Slack workspace.

Signature

Parameters

salesforceUserId

Type: String

teamId

Type: String

Return Value

Type: String

Given a list of Salesforce User IDs in a Slack workspace for a specific Slack App, get the associated Slack user mappings. If at least one successful mapping is possible, then the returned map contains an entry for each supplied Salesforce user ID.

Signature

Parameters

salesforceUserIds

Type: List<String>

teamId

Type: String

Return Value

Type: Map<String, String>