Automate DocuSign Integration Tasks from PowerShell

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

The CData ADO.NET Provider for DocuSign 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 DocuSign.

ADO.NET Provider

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

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

To connect to DocuSign, set the following connection properties:

  • UseSandbox: indicates whether current user account is sandbox or not (FALSE by default)
  • AccountId (optional): set it in the connection string if you have access to multiple Account Ids

Authenticating to DocuSign

DocuSign uses the OAuth authentication standard. To authenticate using OAuth, create an app to obtain the OAuthClientId, OAuthClientSecret, and CallbackURL connection properties. See the Help documentation more information.

  1. Load the provider's assembly:

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

     
    $conn= New-Object System.Data.CData.DocuSign.DocuSignConnection("OAuthClientId=MyClientId; OAuthClientSecret=MyClientSecret; 
    CallbackURL=http://localhost:33333;
    ")
    $conn.Open()
    
  3. Instantiate the DocuSignDataAdapter, execute an SQL query, and output the results:

    
    $sql="SELECT DocumentId, DocumentName from Documents"
    
    $da= New-Object System.Data.CData.DocuSign.DocuSignDataAdapter($sql, $conn)
    $dt= New-Object System.Data.DataTable
    $da.Fill($dt)
    
    $dt.Rows | foreach {
    	Write-Host $_.documentid $_.documentname
    }
      

Ready to get started?

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

 Download Now

Learn more:

DocuSign Icon DocuSign ADO.NET Provider

Rapidly create and deploy powerful .NET applications that integrate with DocuSign data including Accounts, Envelopes, Folders, and more!