Newer Version Available

This content describes an older version of this product. View Latest

Service Cloud Voice for Partner Telephony Apex Reference

Service Cloud Voice for Partner Telephony uses several Apex classes.

This guide is for telephony providers who are creating a solution that integrates Service Cloud Voice with their telephony system. If that’s not you, see the Service Cloud Voice Implementation Guide or the Salesforce Help.

Important

To automate all user operations on the contact center in Salesforce, partners should provide an Apex integration class that implements the supported Apex interfaces.

Make sure, along with implementing the supported interfaces, you also declare that capability in ConversationVendorInfo. If you don’t declare the capability, your implemented methods aren’t called.

Note

When implementing an Apex interface method, if the operation is successful, create a response object using the response constructor with success as true and set the response field. If the operation fails, create a response object with success as false, an appropriate errorMessage, and a null response field.

The following interfaces can be implemented by partners.

service_cloud_voice.PartnerConnector

For this interface, turn on the namedCredentialSupported capability. This interface contains one method.

The ConnectPartnerResponse response has three fields:

  • Success: Boolean value for whether operation was a success or failure.
  • contactCenters: Map of partner contact center ID and partner contact center name.
  • errorMessage: Failure message if the operation failed.

Use the following constructor to create a response instance:

The ContactCenterInfo input value contains information about the contact center, such as the internal name, the display name, the org ID, the partner contact center ID, and the fully qualified name of the named credential selected by user.

service_cloud_voice.RecordingMediaProvider

For this interface, turn on the einsteinConversationInsightsSupported capability. It contains one method to provide the recording URLs, which can be downloaded and analyzed.

The RecordingMediaResponse response is a list of RecordingMediaItem objects. Each item contains recordingUrl, partnerVoiceCallId, and an error message if the recording URL isn’t present. Use the following constructor to create an instance of RecordingMediaItem:

The RecordingMediaRequest input value contains the named credentials to be used for the callout, and the list of partner Voice Call IDs for the recording URLs.

service_cloud_voice.TransferDestinationProvider

For this interface, turn on the partnerTransferDestinationsSupported capability. It contains one method to fetch agent queues.

The TransferDestinationResponse response contains three fields: a success flag, a map of queue ID and queue names, and an error message for a failed operation. Use the following constructor to create a response instance:

service_cloud_voice.PartnerSSO

Implement this interface to set up SSO for the agents with Salesforce as an identity provider. See Set Up Single Sign-On for more information.

For this interface, turn on the agentSSOSupported capability. It contains two methods.

This method is used to create a SAML identity provider in the partner account. SetupSamlIdpRequest has two fields: the SAML XML and the named credential. The SAML XML is generated from the Salesforce identity provider. You can reuse an identity provider since this is needed one time per account.

This method is called from Salesforce to get the ConnectedAppSetupParams, which contains fields to create a connected app in Salesforce. ConnectedAppSetupParams contains acsUrl, entityUrl, customAttributes and sloUrl.

service_cloud_voice.UserSyncing

Implement this interface to automate user syncing. Whenever a user is added or removed from the Salesforce contact center, Salesforce calls these methods on the integration class. For this interface, turn on the agentSSOSupported capability.

The UserSyncingResponse response contains three fields: a success flag, an error message, and a map of a Salesforce user ID and a partner system user ID.

User addition and removal is atomic. That is, users are added or removed in Salesforce only if all the users in that batch are successfully added or removed in a partner system.

Note

UserSyncingRequest contains a Salesforce contact center ID, a named credential, and a list of UserInfo objects, each having a Salesforce user ID, first name, last name, and the Salesforce username of the agent.

service_cloud_voice.KeyProvider

Implement this interface to automate key provisioning and renewal. Whenever a Salesforce contact center is connected to the partner system (during contact center creation flow or later using the Connect Account button on the contact center details page), Salesforce calls the getPublicKey method on the integration class. The same method is also called when the public key is renewed (using the Update Key button on the contact center details page).

For this interface, turn on the keyProvisioningSupported capability.

KeyResponse contains four fields: a success flag, an error message, a public key, and the expiration date of the public key.

service_cloud_voice.PhoneNumberProvider

Implement this interface to support listing phone numbers when creating contact center channels.

PhoneNumberResponse contains a list of PhoneNumberInfos. PhoneNumberInfo contains phoneNumber, countryCode, and an identifier.

PhoneNumberRequest contains ContactCenterInfo.