Automate Talkdesk Integration Tasks from PowerShell

Jerod Johnson
Jerod Johnson
Director, Technology Evangelism
Are you in search of a quick and easy way to access Talkdesk data from PowerShell? This article demonstrates how to utilize the Talkdesk Cmdlets for tasks like connecting to Talkdesk data, automating operations, downloading data, and more.

The CData ADO.NET Provider for Talkdesk is a standard ADO.NET Provider that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to Talkdesk.

ADO.NET Provider

The ADO.NET Provider provides a SQL interface for Talkdesk; this tutorial shows how to use the Provider to retrieve Talkdesk data.

Once you have acquired the necessary connection properties, accessing Talkdesk data in PowerShell can be enabled in three steps.

Talkdesk uses the OAuth 2.0 Client Credentials grant. There is no browser-based authorization step and no callback URL.

Set the following connection properties:

  • AccountName: The name of your Talkdesk account.
  • Region: The region where your Talkdesk instance is deployed. Supported values are US (default), EU, CA, AU, UK, and FedRamp.
  • OAuthClientId: The Client Id assigned when you registered your custom OAuth application.
  • OAuthClientSecret: The Client Secret assigned to your custom OAuth application.

Creating a Custom OAuth Application

  1. Log in to your Talkdesk account and select OAuth Clients from the navigation menu.
  2. Click Create OAuth Client and give the client a descriptive name.
  3. Set Grant Type to Client Credentials.
  4. Click Add scopes and select the scopes for the data you want to access.
  5. Click Create and copy the Client Id and Client Secret.

When you connect, the driver automatically requests an access token from Talkdesk, caches it, and refreshes it when it expires. Make sure the scopes selected for the application match the views you plan to query, or the token request can fail.

  1. Load the provider's assembly:

    
    [Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for Talkdesk\lib\System.Data.CData.Talkdesk.dll")
        
  2. Connect to Talkdesk:

     
    $conn= New-Object System.Data.CData.Talkdesk.TalkdeskConnection("AccountName=myAccount;Region=US;OAuthClientId=myClientId;OAuthClientSecret=myClientSecret;")
    $conn.Open()
    
  3. Instantiate the TalkdeskDataAdapter, execute an SQL query, and output the results:

    
    $sql="SELECT Id, Name from Users"
    
    $da= New-Object System.Data.CData.Talkdesk.TalkdeskDataAdapter($sql, $conn)
    $dt= New-Object System.Data.DataTable
    $da.Fill($dt)
    
    $dt.Rows | foreach {
    	Write-Host $_.id $_.name
    }
      

Ready to get started?

Download a free trial of the Talkdesk Data Provider to get started:

 Download Now

Learn more:

Talkdesk Icon Talkdesk ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with Talkdesk data including Accounts, Attributes, BillingAccounts, Callbacks, Campaigns, Cases, Contacts, GuardianUsers, Invoices, Products, Subscriptions, Teams, Users, Wallets, and more!