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 - 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 3 - 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 4 - 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",
  "integrationId": "*******************",
}

crmPlatform - Set to sunco.

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

Step 5 - 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:

Delete all existing steps and add a 'Ask for details' step, give it a name and add the 'Name' and 'Email' fields.

After the 'Ask for details' step, add the 'Transfer to agent' step, add any relevant tags.

NOTE The required 'Bot message' is visible to the agent, but not the end user.

Save the flow and publish the bot.

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 2 of the Implementation Guide.

Step 3 - Update Agent Handover Object

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

{
  "crmPlatform": "sunco",
  "integrationId": "*******************",
}

crmPlatform - Set to sunco.

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

Step 4 - 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 5 - Configure bot

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:

Delete all existing steps and add a 'Ask for details' step, give it a name and add the 'Name' and 'Email' fields.

After the 'Ask for details' step, add the 'Transfer to agent' step, add any relevant tags.

NOTE The required 'Bot message' is visible to the agent, but not the end user.

Save the flow and publish the bot.

Step 6 - Remove CRM Object From Config

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