Newer Version Available

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

Configure Multiple Connector URLs

You can add multiple connector URLs and the corresponding login URLs in the managed package. The admin can select a connector URL during contact center creation or from the contact center details page.
  1. Set the CapabilitiesSupportsMultiVendorConfig field of the ConversationVendorInfo object to true.
  2. Implement the service_cloud_voice.VendorConfigProvider Apex interface and related classes.
    When the CapabilitiesSupportsMultiVendorConfig field is set to true, the service_cloud_voice.VendorConfigProvider Apex interface must be implemented. Otherwise, the ConversationVendorInfo object can’t be created or updated.

Use these sample code blocks as guides.

This sample interface definition implements the VendorConfigProvider Apex interface to send multiple connector and login URLs.

1global interface VendorConfigProvider {
2/*
3* @description Partners can use this interface implementation to support multiple connector urls for their CVI
4* @param request This contains the request object of type VendorConfigRequest
5* @see VendorConfigRequest
6* @see VendorConfigResponse
7* @since 258
8*/
9VendorConfigResponse getVendorConfigDetails(VendorConfigRequest request);
10}

Implement the VendorConfigRequest Apex class to define the request payload for the getVendorConfigDetails method. This class definition represents the structure of the request containing information about the contact center. A sample implementation is:

1global with sharing class VendorConfigRequest {
2private ContactCenterInfo contactCenterInfo;
3
4/**
5* Constructor for the VendorConfigRequest payload.
6* @param contactCenterInfo - The contact center configuration used to determine the appropriate connector URLs.
7*/
8global VendorConfigRequest(ContactCenterInfo contactCenterInfo) {
9this.contactCenterInfo = contactCenterInfo;
10}
11
12/**
13* Returns the contact center information associated with this request.
14*/
15global ContactCenterInfo getContactCenterInfo() {
16return this.contactCenterInfo;
17}
18
19/**
20* Sets the contact center information for this request.
21*/
22global void setContactCenterInfo(ContactCenterInfo contactCenterInfo) {
23this.contactCenterInfo = contactCenterInfo;
24}
25}

Implement the VendorConfigResponse Apex class to define the list of configurations returned to the system. This class definition represents the format of the response returned from the getVendorConfigDetails method. A sample implementation is:

1global with sharing class VendorConfigResponse extends PartnerResponse {
2private List<VendorConfigInfo> vendorConfig;
3
4/**
5* Constructor for generating a VendorConfigResponse.
6* @param vendorConfig - The list of connector and login URL configurations available for the admin.
7*/
8global VendorConfigResponse (boolean success, String errorMessage, List<VendorConfigInfo> vendorConfig) {
9super(success, errorMessage);
10this.vendorConfig = vendorConfig;
11}
12
13/**
14* Returns the list of vendor configurations.
15*/
16global List<VendorConfigInfo> getVendorConfig() {
17return this.vendorConfig;
18}
19
20/**
21* Sets the list of vendor configurations.
22*/
23global void setVendorConfig(List<VendorConfigInfo> vendorConfig) {
24this.vendorConfig = vendorConfig;
25}
26}

Implement the VendorConfigInfo Apex class to pair a connector URL with its corresponding login URL. This class definition represents the structure of individual entries in the selection list for admins. A sample implementation is:

1global with sharing class VendorConfigInfo {
2private VendorUrl connectorUrl;
3private VendorUrl loginUrl;
4
5/**
6* Constructor for pairing a connector URL with a login URL.
7* @param connectorUrl - The required connector URL for the contact center.
8* @param loginUrl - The optional login URL; if null, the system uses the default login URL from the CVI.
9*/
10global VendorConfigInfo(VendorUrl connectorUrl, VendorUrl loginUrl) {
11this.connectorUrl = connectorUrl;
12this.loginUrl = loginUrl;
13}
14
15/**
16* Returns the connector URL object.
17*/
18global VendorUrl getConnectorUrl() {
19return this.connectorUrl;
20}
21
22/**
23* Returns the login URL object.
24*/
25global VendorUrl getLoginUrl() {
26return this.loginUrl;
27}
28
29/**
30* Sets the connector URL object.
31*/
32global void setConnectorUrl(VendorUrl connectorUrl) {
33this.connectorUrl = connectorUrl;
34}
35
36/**
37* Sets the login URL object.
38*/
39global void setLoginUrl(VendorUrl loginUrl) {
40this.loginUrl = loginUrl;
41}
42}

Implement the VendorUrl Apex class to define a specific URL endpoint along with the display name shown to admins in the UI. This class definition represents the structure of individual URL entries. Each URL has the actual URL and a display name field shown to admins in the selection list. A sample implementation is:

1global with sharing class VendorUrl {
2private String url;
3private String displayName;
4
5/**
6* Constructor for an individual URL endpoint entry.
7* @param url - The actual endpoint URL string.
8* @param displayName - The user-friendly label shown to admins in the UI.
9*/
10global VendorUrl(String url, String displayName) {
11this.url = url;
12this.displayName = displayName;
13}
14
15/**
16* Returns the endpoint URL string.
17*/
18global String getUrl() {
19return this.url;
20}
21
22/**
23* Returns the display name of the URL entry.
24*/
25global String getDisplayName() {
26return this.displayName;
27}
28
29/**
30* Updates the endpoint URL string.
31*/
32global void setUrl(String url) {
33this.url = url;
34}
35
36/**
37* @param displayName - Sets the display name for the URL entry. Use a meaningful name to help admins select the correct option.
38*/
39global void setDisplayName(String displayName) {
40this.displayName = displayName;
41}
42}

An example implementation for the VendorConfigProvider apex interface is:

1/**
2* Example implementation for providing multiple connector URL options. Replace placeholders like <CONNECTOR URL 1> with actual environment-specific endpoints.
3* <CONNECTOR URL 1> represents the connector url value with the actual url. For example, if the connector url is http://example.com, set the value of CONNECTOR URL 1 to http://example.com.
4* <CONNECTOR URL 1 DISPLAY NAME> represents the display name for connector url 1. For example, if the display name for connector url 1 is Emea, then set CONNECTOR URL 1 DISPLAY NAME to Emea.
5* <LOGIN URL 1> represents the login url value with the actual url. For example, if the login url is http://login.example.com, set the value of LOGIN URL 1 to http://login.example.com.
6* <LOGIN URL 1 DISPLAY NAME> represents the display name for login url 1. For example, if the display name for login url 1 is Emea Login, then set LOGIN URL 1 DISPLAY NAME to Emea Login.
7*/
8global class VendorConfigProviderService implements service_cloud_voice.VendorConfigProvider {
9
10global service_cloud_voice.VendorConfigResponse getVendorConfigDetails(service_cloud_voice.VendorConfigRequest configRequest) {
11service_cloud_voice.VendorUrl connectorUrl = new service_cloud_voice.VendorUrl('<CONNECTOR URL 1>', '<CONNECTOR URL 1 DISPLAY NAME>');
12service_cloud_voice.VendorUrl loginUrl = new service_cloud_voice.VendorUrl('<LOGIN URL 1>', '<LOGIN URL 1 DISPLAY NAME>');
13service_cloud_voice.VendorConfigInfo configInfo = new service_cloud_voice.VendorConfigInfo(connectorUrl, loginUrl);
14
15// Create other similar objects for VendorConfigInfo with different connector and login urls, if needed.
16
17List<service_cloud_voice.VendorConfigInfo> vendorConfigResponse = new List<service_cloud_voice.VendorConfigResponse>();
18vendorConfigResponse.add(configInfo);
19
20// Add other config info objects to the list in a similar manner.
21
22return new service_cloud_voice.VendorConfigResponse(true, null, vendorConfigResponse);
23}
24}

Multiple Connector URL Considerations

When you implement the multiple connector URL feature, consider these:
  • The values of connector URL and login URL from the CVI are used as default values. If the admin doesn’t select a connector URL, the CVI defaults are used.
  • Do not send the default CVI URLs in the Apex response to avoid duplicate entries.
  • If no login URL is provided in the Apex response or if you provide a VendorURL object with a null login URL, the default login URL from the CVI is used.
  • Connector URL is mandatory. If not provided in the response, or if VendorURL objects contain a null connector URL, the entry is ignored and isn’t shown to the admin in the UI.