Newer Version Available
Service Cloud Voice for Partner Telephony Apex Reference
To automate all user operations on the contact center in Salesforce, partners should provide an Apex integration class that implements the supported Apex interfaces.
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.
1ConnectPartnerResponse connect(service_cloud_voice.ContactCenterInfo contactCenterInfo);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:
1ConnectPartnerResponse(boolean success, Map<String, String> contactCenters, String errorMessage);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.
1RecordingMediaResponse getSignedUrls(service_cloud_voice.RecordingMediaRequest request);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:
1RecordingMediaItem(String vendorCallKey, String signedRecordingUrl, String errorCode);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.
1TransferDestinationResponse getQueues(service_cloud_voice.ContactCenterInfo contactCenterInfo);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:
1TransferDestinationResponse (boolean success, Map<String, String> queues, String errorMessage);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.
1PartnerResponse setupSamlIdentityProvider(SetupSamlIdpRequest setupSamlIdpRequest);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.
1ConnectedAppSetupParams getConnectedAppSetupParams(ContactCenterInfo contactCenterInfo);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.
1UserSyncingResponse addUsersToContactCenter(UserSyncingRequest userSyncingRequest);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.
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.
1KeyResponse getPublicKey(ContactCenterInfo contactCenterInfo);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.
1PhoneNumberResponse listPhoneNumbers(service_cloud_voice.PhoneNumberRequest phoneNumberRequest);PhoneNumberResponse contains a list of PhoneNumberInfos. PhoneNumberInfo contains phoneNumber, countryCode, and an identifier.
PhoneNumberRequest contains ContactCenterInfo.