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
(PowerBuilder) 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/
integer li_rc oleobject loo_Http integer li_Success oleobject loo_JsonToken oleobject loo_SbResponseBody oleobject loo_JResp integer li_RespStatusCode string ls_OwnerName string ls_EnvelopeId string ls_EnvelopeUri string ls_Status string ls_SenderName string ls_SenderEmail string ls_CreatedDateTime string ls_SentDateTime string ls_CompletedDateTime string ls_Subject string ls_TemplateId string ls_Name string ls_Shared string ls_Password string ls_Description string ls_LastModified integer li_PageCount string ls_Uri string ls_Is21CFRPart11 string ls_IsSignatureProviderEnvelope integer j integer li_Count_j string ls_FieldId string ls_Show string ls_Required string ls_Value string ls_ConfigurationType string ls_ErrorDetailsErrorCode string ls_ErrorDetailsMessage string ls_ResultSetSize string ls_StartPosition string ls_EndPosition string ls_TotalSetSize string ls_PreviousUri string ls_NextUri integer i integer li_Count_i // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loo_Http = create oleobject // Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 li_rc = loo_Http.ConnectToNewObject("Chilkat.Http") if li_rc < 0 then destroy loo_Http MessageBox("Error","Connecting to COM object failed") return end if // Implements the following HTTP request: // GET /restapi/v2.1/accounts/{accountId}/folders/{folderId} // Adds the "Authorization: Bearer eyJ0eXAi.....UE8Kl_V8KroQ" header. loo_JsonToken = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_JsonToken.ConnectToNewObject("Chilkat.JsonObject") // Load a previously obtained OAuth2 access token. li_Success = loo_JsonToken.LoadFile("qa_data/tokens/docusign.json") if li_Success = 0 then Write-Debug loo_JsonToken.LastErrorText destroy loo_Http destroy loo_JsonToken return end if loo_Http.AuthToken = loo_JsonToken.StringOf("access_token") // Use your account ID and a valid folderId here: loo_Http.SetUrlVar("accountId","7f3f65ed-5e87-418d-94c1-92499ddc8252") loo_Http.SetUrlVar("folderId","94644782-31b7-4f82-a2c1-26d8a9306f8c") loo_SbResponseBody = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Http.QuickGetSb("https://demo.docusign.net/restapi/v2.1/accounts/{$accountId}/folders/{$folderId}",loo_SbResponseBody) if li_Success = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_JsonToken destroy loo_SbResponseBody return end if loo_JResp = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject") loo_JResp.LoadSb(loo_SbResponseBody) loo_JResp.EmitCompact = 0 Write-Debug "Response Body:" Write-Debug loo_JResp.Emit() li_RespStatusCode = loo_Http.LastStatus Write-Debug "Response Status Code = " + string(li_RespStatusCode) if li_RespStatusCode >= 400 then Write-Debug "Response Header:" Write-Debug loo_Http.LastResponseHeader Write-Debug "Failed." destroy loo_Http destroy loo_JsonToken destroy loo_SbResponseBody destroy loo_JResp return end if // 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 ls_ResultSetSize = loo_JResp.StringOf("resultSetSize") ls_StartPosition = loo_JResp.StringOf("startPosition") ls_EndPosition = loo_JResp.StringOf("endPosition") ls_TotalSetSize = loo_JResp.StringOf("totalSetSize") ls_PreviousUri = loo_JResp.StringOf("previousUri") ls_NextUri = loo_JResp.StringOf("nextUri") i = 0 li_Count_i = loo_JResp.SizeOfArray("folderItems") do while i < li_Count_i loo_JResp.I = i ls_OwnerName = loo_JResp.StringOf("folderItems[i].ownerName") ls_EnvelopeId = loo_JResp.StringOf("folderItems[i].envelopeId") ls_EnvelopeUri = loo_JResp.StringOf("folderItems[i].envelopeUri") ls_Status = loo_JResp.StringOf("folderItems[i].status") ls_SenderName = loo_JResp.StringOf("folderItems[i].senderName") ls_SenderEmail = loo_JResp.StringOf("folderItems[i].senderEmail") ls_CreatedDateTime = loo_JResp.StringOf("folderItems[i].createdDateTime") ls_SentDateTime = loo_JResp.StringOf("folderItems[i].sentDateTime") ls_CompletedDateTime = loo_JResp.StringOf("folderItems[i].completedDateTime") ls_Subject = loo_JResp.StringOf("folderItems[i].subject") ls_TemplateId = loo_JResp.StringOf("folderItems[i].templateId") ls_Name = loo_JResp.StringOf("folderItems[i].name") ls_Shared = loo_JResp.StringOf("folderItems[i].shared") ls_Password = loo_JResp.StringOf("folderItems[i].password") ls_Description = loo_JResp.StringOf("folderItems[i].description") ls_LastModified = loo_JResp.StringOf("folderItems[i].lastModified") li_PageCount = loo_JResp.IntOf("folderItems[i].pageCount") ls_Uri = loo_JResp.StringOf("folderItems[i].uri") ls_Is21CFRPart11 = loo_JResp.StringOf("folderItems[i].is21CFRPart11") ls_IsSignatureProviderEnvelope = loo_JResp.StringOf("folderItems[i].isSignatureProviderEnvelope") j = 0 li_Count_j = loo_JResp.SizeOfArray("folderItems[i].customFields") do while j < li_Count_j loo_JResp.J = j ls_FieldId = loo_JResp.StringOf("folderItems[i].customFields[j].fieldId") ls_Name = loo_JResp.StringOf("folderItems[i].customFields[j].name") ls_Show = loo_JResp.StringOf("folderItems[i].customFields[j].show") ls_Required = loo_JResp.StringOf("folderItems[i].customFields[j].required") ls_Value = loo_JResp.StringOf("folderItems[i].customFields[j].value") ls_ConfigurationType = loo_JResp.StringOf("folderItems[i].customFields[j].configurationType") ls_ErrorDetailsErrorCode = loo_JResp.StringOf("folderItems[i].customFields[j].errorDetails.errorCode") ls_ErrorDetailsMessage = loo_JResp.StringOf("folderItems[i].customFields[j].errorDetails.message") j = j + 1 loop i = i + 1 loop destroy loo_Http destroy loo_JsonToken destroy loo_SbResponseBody destroy loo_JResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.