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
(Lianja) 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. loHttp = createobject("CkHttp") // Implements the following HTTP request: // GET /restapi/v2.1/accounts/{accountId}/folders/{folderId} // Adds the "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ" header. loJsonToken = createobject("CkJsonObject") // Load a previously obtained OAuth2 access token. llSuccess = loJsonToken.LoadFile("qa_data/tokens/docusign.json") if (llSuccess = .F.) then ? loJsonToken.LastErrorText release loHttp release loJsonToken return 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") loSbResponseBody = createobject("CkStringBuilder") llSuccess = loHttp.QuickGetSb("https://demo.docusign.net/restapi/v2.1/accounts/{$accountId}/folders/{$folderId}",loSbResponseBody) if (llSuccess = .F.) then ? loHttp.LastErrorText release loHttp release loJsonToken release loSbResponseBody return endif loJResp = createobject("CkJsonObject") loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = .F. ? "Response Body:" ? loJResp.Emit() lnRespStatusCode = loHttp.LastStatus ? "Response Status Code = " + str(lnRespStatusCode) if (lnRespStatusCode >= 400) then ? "Response Header:" ? loHttp.LastHeader ? "Failed." release loHttp release loJsonToken release loSbResponseBody release loJResp return 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.