Documentation

Sunco SDK Implementation Guide

Sunco SDK Implementation Guide

Step 1 - Update Chat Widget Configuration

Below is a complete example of all configurations relevant to SunCo:

  window.DG_CHAT_WIDGET_CONFIG = {
    crmSDKPlatform: 'sunco', // Required
    generalSettings: {
      enableCrmUserAttachments: true,
    },
    csat: {
      type: 'thumbs', // Required
      commentsCharacterLimit: 128, // Required
    },
    lang: {
      userClosedChatMessageToAgent: '*** USER CLOSED CHAT. ***',
      csatLang: {
        ratingsText: ['Bad', 'Good'], // Required
      },
    },
  }

crmSDKPlatform - When set to sunco, the Sunco SDK script is injected into the customers page.

generalSettings -> enableCrmUserAttachments - Enables the user to upload attachments at any point after handing over to SunCo.

csat -> type - Sets the CSAT type to thumbs, bringing the DigitalGenius CSAT inline with Zendesks.

csat -> commentsCharacterLimit - Sets the character limit to 128, bringing the DigitalGenius CSAT comments inline with Zendesks.

lang -> csatLang -> ratingsText - The text displayed when the thumbs up / down CSAT icons are hovered over.

lang -> userClosedChatMessageToAgent - A message sent to the agent on the users behalf when the user ends chat before the agent has requested CSAT.

Step 2 - Create a Connection on DigitalGenius Dashboard

From your DigitalGenius dashboard go to the 'Modules' section and click on the 'Sunshine Conversations' module. Select 'Add Connection'.

Provide a name for your new connection and click on the 'Connect' button.

Next, you will need to specify your Zendesk subdomain and sign in.

You will be asked to authorize the connection, select 'Allow'.

You will then be redirected back to the Sunshine Conversations Modules page where you can test your new DigitalGenius connection to Sunshine Conversations.

If everything was set up correctly you should see a green check mark.

Step 3 - Setup Connection with SunCo API

In the Zendesk admin center, navigate to Apps and Integrations -> APIs -> Conversations API.

Select 'Create API key' and give your key a name, then select 'Next'.

Copy the App ID, Key ID and Secret key values and copy them in to the DigitalGenius postman collection environment variables in the SunCo section (if you have the latest version of Postman you can use the filter at the top of the env variables modal to filter by sunco):

Put the App ID value in to the sunco_app_id field

Put the Key ID value in to the sunco_api_key_id field

Put the Secret key value in to the sunco_api_key_secret field

Go back to the Sunco admin and click on the Next button.

Step 4 - Get Web Integration ID

In Postman, navigate to Genius Flow API collection -> Integrations -> Sunshine Conversations -> SunCo Setup

Execute the GET Get Integrations endpoint, find the integration with "type": "web", copy it's ID and store it somewhere safe.

Step 5 - Get Switchboard Integration ID

In Postman, navigate to Genius Flow API collection -> Integrations -> Sunshine Conversations -> SunCo Setup

Execute the GET List Switchboards endpoint, there should only be one switchboard so copy it's ID and paste it in the sunco_switchboard_id Postman environment variable.

Execute the GET Get Switchboard Integrations endpoint, find the integration with "integrationType": "zd:agentWorkspace",, copy it's ID and store it somewhere safe.

Step 6 - Flow Agent Handover

In flow, add a new chat activity at the point where handover is required.

Select 'Agent Handover' and populate the JSON input with the following fields:

{
  "crmPlatform": "sunco",
  "connectionId": "*******************",
  "appId": "*******************",
  "integrationId": "*******************",
  "switchboardIntegrationId": "*******************",
  "groupId": "*******************",
  "tags": "tag1, tag2, tag3"
}

crmPlatform - Set to sunco.

connectionId - The ID of the connection created in Step 2.

appId - The 'App ID' which was generated in step 3.

integrationId - The ID of the SunCo web integration copied in step 4.

switchboardIntegrationId - The ID of the SunCo zd:agentWorkspace switchboard integration copied in Step 5.

groupId (Optional) - The ID of the Zendesk group tickets should be assigned to.

Step 7 - Configure ZD bot in Zendesk

In the Zendesk admin center, navigate to Channels -> AI agents -> Manage conversation bots.

If you do not have a zd bot configured, click 'Create bot' in the top right. Give the bot a name and proceed through the steps.

Edit your bot and select the 'Behavior' tab, ensure the bot starts with the answer 'Speak to a human'.

Next, we need to configure the 'Speak to a human' answer:

Here we have a flow with several default steps, delete all steps, then add a 'Send message' step with some text to inform the user they are being tranferred to an agent. The complete flow should look like this:

Save the flow.

Migration Guide to Chat Widget V3

Step 1 - Update Chat Widget Config

Add the following to your chat widget config:

  window.DG_CHAT_WIDGET_CONFIG = {
    crmSDKPlatform: 'sunco', // Required
    generalSettings: {
      enableCrmUserAttachments: true,
    },
    csat: {
      type: 'thumbs', // Required
      commentsCharacterLimit: 128, // Required
    },
    lang: {
      userClosedChatMessageToAgent: '*** USER CLOSED CHAT. ***',
      csatLang: {
        ratingsText: ['Bad', 'Good'], // Required
      },
    },
  }

These options explained further in Step 1 of the Implementation Guide.

Step 2 - Get Web Integration ID

In Postman, navigate to Genius Flow API collection -> Integrations -> Sunshine Conversations -> SunCo Setup

Execute the GET Get Integrations endpoint. In the response, find the integration with "type": "web", copy it's ID and store it somewhere safe.

If you don't have credentials to make the request, you may need to create a new Conversation API key, detailed in Step 3 of the Implementation Guide.

Step 3 - Get Switchboard Integration ID

In Postman, navigate to Genius Flow API collection -> Integrations -> Sunshine Conversations -> SunCo Setup

Execute the GET List Switchboards endpoint, there should only be one switchboard so copy it's ID and paste it in the sunco_switchboard_id Postman environment variable.

Execute the GET Get Switchboard Integrations endpoint, find the integration with "integrationType": "zd:agentWorkspace",, copy it's ID and store it somewhere safe.

Step 4 - Update Agent Handover Object

In Flow, ensure the Agent Handover activity JSON object has the following properties:

{
  "crmPlatform": "sunco",
  "appId": "*******************",
  "integrationId": "*******************",
  "switchboardIntegrationId": "*******************",
  "connectionId": "*******************",
  "groupId": "*******************",
}

crmPlatform - Set to sunco.

appId - The 'App ID' which can be found in the Zendesk admin center (Apps and Integrations -> APIs -> Conversations API).

integrationId - The ID of the SunCo web integration copied in step 2.

switchboardIntegrationId - The ID of the SunCo zd:agentWorkspace switchboard integration copied in Step 3.

connectionId - The ID of the DigitalGenius 'Sunshine Conversations' connection.

groupId (Optional) - The ID of the Zendesk group tickets should be assigned to.

Step 5 - Disconnect DigitalGenius Bot

In the Zendesk admin center, navigate to Channels -> Bots -> Manage bots.

Under Marketplace bots, select 'Disconnect' next to the DigitalGenius bot, and again in the following popup.

This removes DigitalGenius from the switchboard and sets the default switchboard integration to zd:answerBot.

If the 'Disconnect' button on the DG bot is disabled, uninstall then reinstall it by following step 2 of the integration guide (the DG bot needs to be installed but not connected).

Step 6 - Configure bot

If you do not have a zd bot configured, click 'Create bot' in the top right. Give the bot a name and proceed through the steps.

Edit your bot and select the 'Behavior' tab, ensure the bot starts with the answer 'Speak to a human'.

Next, we need to configure the 'Speak to a human' answer:

Here we have a flow with several default steps, delete all steps, then add the 'Transfer to agent' step. The step must have a Bot message, this message is sent to chat on handover. The complete flow should look like this:

Save the flow.

Step 7 - Remove CRM Object From Config

Now the migration is complete, you can safely remove the crm object from the chat widget config.