Setup Steps
Save the SunCo App Id as a Flow Configuration
Go to your app in the SunCo dashboard, open Settings and copy the App Id.
Open your Flow in the DG dashboard and save the App ID as a Flow Configuration. You will also use it in some of the steps below.
Create SunCo Connection from DG dashboard
Open DG Tools and Select the Integrations tab.
Click Connect under Zendesk Sunshine Conversations to create a new connection.
After you click Connect you will be redirected to SunCo/Zendesk and will be asked to give DigitalGenius access to your SunCo/Zendesk account. Click Allow.
After successful connection you will be redirected back to DigitalGenius dashboard and you should see a success notification that the connection was established.
Copy SunCo Token
Expand the list of Connected Zendesk Sunshine Conversations Instances and you will see the connection you just created. Click Copy Token as you will use it in some of the steps below.
Copy the ID of DG Flow
To get the ID of the DG flow, open your flow and then you can get the ID either from the URL or from the ID field on the left panel.
Save it as you will use it in the next step.
Create Webhook on SunCo
Create a webhook target on SunCo platform using the below API call.
Replace {{sunco_app_id}} with the ID of the app in your SunCo account.
Replace {{sunco_token}} with the token from step above.
Replace {{flow_id}} with the ID of the flow fro previous step.
Replace {{region}} with either "eu" or "us" depending on the region of your DG account, you can see it in the URL of your dashboard, https://us.digitalgenius.com or https://eu.digitalgenius.com.
curl 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/integrations/me/webhooks' \
-H 'Authorization: Bearer {{sunco_token}}' \
-H 'Content-Type: application/json' \
-d '{
"target": "https://flow-server.{{region}}.dgdeepai.com/sunshine/{{flow_id}}/messages",
"triggers": [
"conversation:message",
"conversation:postback"
],
"version": "v2"
}'
After creating the webhook, copy the webhook secret and use it in the next step.
Link SunCo Webhook to DG Flow
Replace {{sunshine_webhook_secret}} with the webhook secret from the previous step.
Replace {{flow_id}} with the ID of the flow from the earlier step.
Replace {{region}} with either "eu" or "us" depending on the region of your DG account, you can see it in the URL of your dashboard, https://us.digitalgenius.com or https://eu.digitalgenius.com.
Replace {{dg_token}} with the base64 encoding of the DG API Key and Secret. You can get them in API Key/Secret.
curl --request PATCH 'https://flow-server.{{region}}.dgdeepai.com/flow/{{flow_id}}' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic {{dg_token}}' \
--data-raw '{
"external_account_key": "{{sunshine_webhook_secret}}"
}'
Get SunCo App API Key/Secret
In all the below API calls you will need to use the SunCo API Key and Secret to authenticate. You can get them in your SunCo app dashboard. Go to your app, then Settings and you will see the section below.
Create Switchboard
If the switchboard doesn't exist then create a new one using the following example.
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
curl --request POST 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards' \
--header 'Authorization: Basic {{sunco_app_token}}'
When you add the switchboard you will get back the switchboard ID. Copy that for the following steps.
If you already have a switchboard then you can get it using the following example.
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
curl --request GET 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards' \
--header 'Authorization: Basic {{sunco_app_token}}'
DG Switchboard Integration
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
Replace {{sunco_switchboard_id}} with the ID of your switchboard from the previous step.
curl --location -g --request POST 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards/{{sunco_switchboard_id}}/switchboardIntegrations' \
--header 'Authorization: Basic {{sunco_app_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "DG",
"integrationType": "digitalgenius",
"deliverStandbyEvents": false
}'
Save the ID of the DG Switchboard Integration for one the follow steps.
Zendesk Switchboard Integration
Create a Switchboard Integration for Zendesk if one doesn't exist yet.
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
Replace {{sunco_switchboard_id}} with the ID of your switchboard from the previous step.
Replace {{sunco_dg_switchboard_integration_id}} with the Id of the DG SunCo Switchboard Integration created in one of the previous steps.
curl --request POST 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards/{{sunco_switchboard_id}}/switchboardIntegrations' \
--header 'Authorization: Basic {{sunco_app_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"name": "ZD",
"integrationType": "zd:agentWorkspace",
"deliverStandbyEvents": false,
"messageHistoryCount": 10,
"nextSwitchboardIntegrationId": "{{sunco_dg_switchboard_integration_id}}"
}'
Save the ID of the Zendesk Switchboard Integration for one the follow steps.
Update DG Switchboard Integration to point to the Zendesk Switchboard Integration
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
Replace {{sunco_switchboard_id}} with the ID of your switchboard from the previous step.
Replace {{sunco_zendesk_switchboard_integration_id}} with the Id of the Zendesk SunCo Switchboard Integration created in one of the previous steps.
curl --request PATCH 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards/{{sunco_switchboard_id}}/switchboardIntegrations/{{sunco_switchboard_integration_id}}' \
--header 'Authorization: Basic {{sunco_app_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"nextSwitchboardIntegrationId": "{{sunco_zendesk_switchboard_integration_id}}"
}'
Enable the switchboard and make DG the default integration
Replace {{sunco_app_token}} with the base64 encoding of the SunCo App API Key and Secret.
Replace {{sunco_app_id}} with the ID of your SunCo app.
Replace {{sunco_switchboard_id}} with the ID of your switchboard from the previous step.
Replace {{sunco_dg_switchboard_integration_id}} with the Id of the DG SunCo Switchboard Integration created in one of the previous steps.
curl --location -g --request PATCH 'https://api.smooch.io/v2/apps/{{sunco_app_id}}/switchboards/{{sunco_switchboard_id}}' \
--header 'Authorization: Basic {{sunco_app_token}}' \
--header 'Content-Type: application/json' \
--data-raw '{
"defaultSwitchboardIntegrationId": "{{sunco_dg_switchboard_integration_id}}",
"enabled": true
}'
Updated 10 months ago