Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) DocuSign List Folder ItemsSee more DocuSign ExamplesRetrieves a list of the envelopes in the specified folder. For more information, see https://developers.docusign.com/docs/esign-rest-api/reference/folders/folders/listitems/
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") Local $bSuccess ; Implements the following HTTP request: ; GET /restapi/v2.1/accounts/{accountId}/folders/{folderId} ; Adds the "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ" header. $oJsonToken = ObjCreate("Chilkat.JsonObject") ; Load a previously obtained OAuth2 access token. $bSuccess = $oJsonToken.LoadFile("qa_data/tokens/docusign.json") If ($bSuccess = False) Then ConsoleWrite($oJsonToken.LastErrorText & @CRLF) Exit EndIf $oHttp.AuthToken = $oJsonToken.StringOf("access_token") ; Use your account ID and a valid folderId here: $oHttp.SetUrlVar("accountId","7f3f65ed-5e87-418d-94c1-92499ddc8252") $oHttp.SetUrlVar("folderId","94644782-31b7-4f82-a2c1-26d8a9306f8c") $oSbResponseBody = ObjCreate("Chilkat.StringBuilder") $bSuccess = $oHttp.QuickGetSb("https://demo.docusign.net/restapi/v2.1/accounts/{$accountId}/folders/{$folderId}",$oSbResponseBody) If ($bSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf $oJResp = ObjCreate("Chilkat.JsonObject") $oJResp.LoadSb($oSbResponseBody) $oJResp.EmitCompact = False ConsoleWrite("Response Body:" & @CRLF) ConsoleWrite($oJResp.Emit() & @CRLF) Local $iRespStatusCode = $oHttp.LastStatus ConsoleWrite("Response Status Code = " & $iRespStatusCode & @CRLF) If ($iRespStatusCode >= 400) Then ConsoleWrite("Response Header:" & @CRLF) ConsoleWrite($oHttp.LastResponseHeader & @CRLF) ConsoleWrite("Failed." & @CRLF) Exit EndIf ; Sample JSON response: ; (Sample code for parsing the JSON response is shown below) ; { ; "resultSetSize": "sample string 1", ; "startPosition": "sample string 2", ; "endPosition": "sample string 3", ; "totalSetSize": "sample string 4", ; "previousUri": "sample string 5", ; "nextUri": "sample string 6", ; "folderItems": [ ; { ; "ownerName": "sample string 1", ; "envelopeId": "sample string 2", ; "envelopeUri": "sample string 3", ; "status": "sample string 4", ; "senderName": "sample string 5", ; "senderEmail": "sample string 6", ; "createdDateTime": "sample string 7", ; "sentDateTime": "sample string 8", ; "completedDateTime": "sample string 9", ; "subject": "sample string 10", ; "templateId": "sample string 11", ; "name": "sample string 12", ; "shared": "sample string 13", ; "password": "sample string 14", ; "description": "sample string 15", ; "lastModified": "sample string 16", ; "pageCount": 17, ; "uri": "sample string 18", ; "is21CFRPart11": "sample string 19", ; "isSignatureProviderEnvelope": "sample string 20", ; "customFields": [ ; { ; "fieldId": "sample string 1", ; "name": "sample string 2", ; "show": "sample string 3", ; "required": "sample string 4", ; "value": "sample string 5", ; "configurationType": "sample string 6", ; "errorDetails": { ; "errorCode": "sample string 1", ; "message": "sample string 2" ; } ; } ; ] ; } ; ] ; } ; Sample code for parsing the JSON response... ; Use the following online tool to generate parsing code from sample JSON: ; Generate Parsing Code from JSON Local $sOwnerName Local $sEnvelopeId Local $sEnvelopeUri Local $status Local $senderName Local $senderEmail Local $sCreatedDateTime Local $sentDateTime Local $sCompletedDateTime Local $subject Local $sTemplateId Local $sName Local $shared Local $sPassword Local $sDescription Local $sLastModified Local $iPageCount Local $sUri Local $sIs21CFRPart11 Local $sIsSignatureProviderEnvelope Local $iJ Local $iCount_j Local $sFieldId Local $show Local $sRequired Local $sValue Local $sConfigurationType Local $sErrorDetailsErrorCode Local $sErrorDetailsMessage Local $sResultSetSize = $oJResp.StringOf("resultSetSize") Local $startPosition = $oJResp.StringOf("startPosition") Local $sEndPosition = $oJResp.StringOf("endPosition") Local $sTotalSetSize = $oJResp.StringOf("totalSetSize") Local $sPreviousUri = $oJResp.StringOf("previousUri") Local $sNextUri = $oJResp.StringOf("nextUri") Local $i = 0 Local $iCount_i = $oJResp.SizeOfArray("folderItems") While $i < $iCount_i $oJResp.I = $i $sOwnerName = $oJResp.StringOf("folderItems[i].ownerName") $sEnvelopeId = $oJResp.StringOf("folderItems[i].envelopeId") $sEnvelopeUri = $oJResp.StringOf("folderItems[i].envelopeUri") $status = $oJResp.StringOf("folderItems[i].status") $senderName = $oJResp.StringOf("folderItems[i].senderName") $senderEmail = $oJResp.StringOf("folderItems[i].senderEmail") $sCreatedDateTime = $oJResp.StringOf("folderItems[i].createdDateTime") $sentDateTime = $oJResp.StringOf("folderItems[i].sentDateTime") $sCompletedDateTime = $oJResp.StringOf("folderItems[i].completedDateTime") $subject = $oJResp.StringOf("folderItems[i].subject") $sTemplateId = $oJResp.StringOf("folderItems[i].templateId") $sName = $oJResp.StringOf("folderItems[i].name") $shared = $oJResp.StringOf("folderItems[i].shared") $sPassword = $oJResp.StringOf("folderItems[i].password") $sDescription = $oJResp.StringOf("folderItems[i].description") $sLastModified = $oJResp.StringOf("folderItems[i].lastModified") $iPageCount = $oJResp.IntOf("folderItems[i].pageCount") $sUri = $oJResp.StringOf("folderItems[i].uri") $sIs21CFRPart11 = $oJResp.StringOf("folderItems[i].is21CFRPart11") $sIsSignatureProviderEnvelope = $oJResp.StringOf("folderItems[i].isSignatureProviderEnvelope") $iJ = 0 $iCount_j = $oJResp.SizeOfArray("folderItems[i].customFields") While $iJ < $iCount_j $oJResp.J = $iJ $sFieldId = $oJResp.StringOf("folderItems[i].customFields[j].fieldId") $sName = $oJResp.StringOf("folderItems[i].customFields[j].name") $show = $oJResp.StringOf("folderItems[i].customFields[j].show") $sRequired = $oJResp.StringOf("folderItems[i].customFields[j].required") $sValue = $oJResp.StringOf("folderItems[i].customFields[j].value") $sConfigurationType = $oJResp.StringOf("folderItems[i].customFields[j].configurationType") $sErrorDetailsErrorCode = $oJResp.StringOf("folderItems[i].customFields[j].errorDetails.errorCode") $sErrorDetailsMessage = $oJResp.StringOf("folderItems[i].customFields[j].errorDetails.message") $iJ = $iJ + 1 Wend $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.