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
(Visual FoxPro) 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/
LOCAL loHttp LOCAL lnSuccess LOCAL loJsonToken LOCAL loSbResponseBody LOCAL loJResp LOCAL lnRespStatusCode LOCAL lcOwnerName LOCAL lcEnvelopeId LOCAL lcEnvelopeUri LOCAL lcStatus LOCAL lcSenderName LOCAL lcSenderEmail LOCAL lcCreatedDateTime LOCAL lcSentDateTime LOCAL lcCompletedDateTime LOCAL lcSubject LOCAL lcTemplateId LOCAL lcName LOCAL lcShared LOCAL lcPassword LOCAL lcDescription LOCAL lcLastModified LOCAL lnPageCount LOCAL lcUri LOCAL lcIs21CFRPart11 LOCAL lcIsSignatureProviderEnvelope LOCAL j LOCAL lnCount_j LOCAL lcFieldId LOCAL lcShow LOCAL lcRequired LOCAL lcValue LOCAL lcConfigurationType LOCAL lcErrorDetailsErrorCode LOCAL lcErrorDetailsMessage LOCAL lcResultSetSize LOCAL lcStartPosition LOCAL lcEndPosition LOCAL lcTotalSetSize LOCAL lcPreviousUri LOCAL lcNextUri LOCAL i LOCAL lnCount_i * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http') loHttp = CreateObject('Chilkat.Http') * Implements the following HTTP request: * GET /restapi/v2.1/accounts/{accountId}/folders/{folderId} * Adds the "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ" header. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJsonToken = CreateObject('Chilkat.JsonObject') * Load a previously obtained OAuth2 access token. lnSuccess = loJsonToken.LoadFile("qa_data/tokens/docusign.json") IF (lnSuccess = 0) THEN ? loJsonToken.LastErrorText RELEASE loHttp RELEASE loJsonToken CANCEL ENDIF loHttp.AuthToken = loJsonToken.StringOf("access_token") * Use your account ID and a valid folderId here: loHttp.SetUrlVar("accountId","7f3f65ed-5e87-418d-94c1-92499ddc8252") loHttp.SetUrlVar("folderId","94644782-31b7-4f82-a2c1-26d8a9306f8c") * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder') loSbResponseBody = CreateObject('Chilkat.StringBuilder') lnSuccess = loHttp.QuickGetSb("https://demo.docusign.net/restapi/v2.1/accounts/{$accountId}/folders/{$folderId}",loSbResponseBody) IF (lnSuccess = 0) THEN ? loHttp.LastErrorText RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody CANCEL ENDIF * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJResp = CreateObject('Chilkat.JsonObject') loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = 0 ? "Response Body:" ? loJResp.Emit() lnRespStatusCode = loHttp.LastStatus ? "Response Status Code = " + STR(lnRespStatusCode) IF (lnRespStatusCode >= 400) THEN ? "Response Header:" ? loHttp.LastResponseHeader ? "Failed." RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody RELEASE loJResp CANCEL 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 lcResultSetSize = loJResp.StringOf("resultSetSize") lcStartPosition = loJResp.StringOf("startPosition") lcEndPosition = loJResp.StringOf("endPosition") lcTotalSetSize = loJResp.StringOf("totalSetSize") lcPreviousUri = loJResp.StringOf("previousUri") lcNextUri = loJResp.StringOf("nextUri") i = 0 lnCount_i = loJResp.SizeOfArray("folderItems") DO WHILE i < lnCount_i loJResp.I = i lcOwnerName = loJResp.StringOf("folderItems[i].ownerName") lcEnvelopeId = loJResp.StringOf("folderItems[i].envelopeId") lcEnvelopeUri = loJResp.StringOf("folderItems[i].envelopeUri") lcStatus = loJResp.StringOf("folderItems[i].status") lcSenderName = loJResp.StringOf("folderItems[i].senderName") lcSenderEmail = loJResp.StringOf("folderItems[i].senderEmail") lcCreatedDateTime = loJResp.StringOf("folderItems[i].createdDateTime") lcSentDateTime = loJResp.StringOf("folderItems[i].sentDateTime") lcCompletedDateTime = loJResp.StringOf("folderItems[i].completedDateTime") lcSubject = loJResp.StringOf("folderItems[i].subject") lcTemplateId = loJResp.StringOf("folderItems[i].templateId") lcName = loJResp.StringOf("folderItems[i].name") lcShared = loJResp.StringOf("folderItems[i].shared") lcPassword = loJResp.StringOf("folderItems[i].password") lcDescription = loJResp.StringOf("folderItems[i].description") lcLastModified = loJResp.StringOf("folderItems[i].lastModified") lnPageCount = loJResp.IntOf("folderItems[i].pageCount") lcUri = loJResp.StringOf("folderItems[i].uri") lcIs21CFRPart11 = loJResp.StringOf("folderItems[i].is21CFRPart11") lcIsSignatureProviderEnvelope = loJResp.StringOf("folderItems[i].isSignatureProviderEnvelope") j = 0 lnCount_j = loJResp.SizeOfArray("folderItems[i].customFields") DO WHILE j < lnCount_j loJResp.J = j lcFieldId = loJResp.StringOf("folderItems[i].customFields[j].fieldId") lcName = loJResp.StringOf("folderItems[i].customFields[j].name") lcShow = loJResp.StringOf("folderItems[i].customFields[j].show") lcRequired = loJResp.StringOf("folderItems[i].customFields[j].required") lcValue = loJResp.StringOf("folderItems[i].customFields[j].value") lcConfigurationType = loJResp.StringOf("folderItems[i].customFields[j].configurationType") lcErrorDetailsErrorCode = loJResp.StringOf("folderItems[i].customFields[j].errorDetails.errorCode") lcErrorDetailsMessage = loJResp.StringOf("folderItems[i].customFields[j].errorDetails.message") j = j + 1 ENDDO i = i + 1 ENDDO RELEASE loHttp RELEASE loJsonToken RELEASE loSbResponseBody RELEASE loJResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.