![]() |
VOOZH | about |
The CData Cmdlets for DocuSign are standard PowerShell cmdlets that make it easy to accomplish data cleansing, normalization, backup, and other integration tasks by enabling real-time access to DocuSign.
The Cmdlets are not only a PowerShell interface to DocuSign, but also an SQL interface; this tutorial shows how to use both to retrieve DocuSign data. We also show examples of the ADO.NET equivalent, which is possible with the CData ADO.NET Provider for DocuSign. To access DocuSign data from other .NET applications, like LINQPad, use the CData ADO.NET Provider for DocuSign.
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:
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.
Install the module:
Install-Module DocuSignCmdlets
Connect:
$docusign = Connect-DocuSign -OAuthClientId "$OAuthClientId" -OAuthClientSecret "$OAuthClientSecret" -CallbackURL "$CallbackURL"
Search for and retrieve data:
$documentname = "TPSReport" $documents = Select-DocuSign -Connection $docusign -Table "Documents" -Where "DocumentName = `'$DocumentName`'" $documents
You can also use the Invoke-DocuSign cmdlet to execute SQL commands:
$documents = Invoke-DocuSign -Connection $docusign -Query 'SELECT * FROM Documents WHERE DocumentName = @DocumentName' -Params @{'@DocumentName'='TPSReport'}
Load the provider's assembly:
[Reflection.Assembly]::LoadFile("C:\Program Files\CData\CData ADO.NET Provider for DocuSign\lib\System.Data.CData.DocuSign.dll")
Connect to DocuSign:
$conn= New-Object System.Data.CData.DocuSign.DocuSignConnection("OAuthClientId=MyClientId; OAuthClientSecret=MyClientSecret;
CallbackURL=http://localhost:33333;
")
$conn.Open()
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
}
Download a free trial of the DocuSign Data Provider to get started:
Download NowLearn more:
👁 DocuSign IconRapidly create and deploy powerful .NET applications that integrate with DocuSign data including Accounts, Envelopes, Folders, and more!