-
Notifications
You must be signed in to change notification settings - Fork 7
/
eg004EnvelopeInfo.ps1
41 lines (32 loc) · 1.17 KB
/
eg004EnvelopeInfo.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
$apiUri = "https://demo.docusign.net/restapi"
# Get the envelope's details
# This script uses the envelope_id stored in ../envelope_id.
# The envelope_id file is created by example eg002SigningViaEmail.ps1 or
# can be manually created.
# ***DS.snippet.0.start
# Step 1. Obtain your Oauth access token
$accessToken = Get-Content .\config\ds_access_token.txt
# Obtain your accountId from demo.docusign.net -- the account id is shown in
# the drop down on the upper right corner of the screen by your picture or
# the default picture.
$accountID = Get-Content .\config\API_ACCOUNT_ID
# Check that we have an envelope id
if (Test-Path .\config\ENVELOPE_ID) {
$envelopeID = Get-Content .\config\ENVELOPE_ID
}
else {
Write-Output "An envelope id is needed. Fix: execute step 2 - Signing_Via_Email"
exit 1
}
Write-Output "Sending the Envelopes::get request to DocuSign..."
Write-Output "Results:"
#ds-snippet-start:eSign4Step2
Invoke-RestMethod `
-Uri "${apiUri}/v2.1/accounts/${accountId}/envelopes/${envelopeId}" `
-Method 'GET' `
-Headers @{
'Authorization' = "Bearer $accessToken";
'Content-Type' = "application/json";
}
#ds-snippet-end:eSign4Step2
Write-Output "Done."