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) Yousign Create Procedure after Uploading the PDFDemonstrates the 2nd step of Yousign procedure creation. This is the call to create the procedure after previously uploading the PDF file. For more information, see https://dev.yousign.com/?version=latest#c2e03a8b-f782-4d3e-96d1-04517c083497
integer li_rc oleobject loo_Http integer li_Success oleobject loo_Json oleobject loo_Resp oleobject loo_SbResponseBody oleobject loo_JResp integer li_RespStatusCode string ls_User string ls_V_type string ls_Firstname string ls_Lastname string ls_Email string ls_Phone integer li_Position string ls_Comment string ls_OperationLevel string ls_OperationModeSmsConfig integer j integer li_Count_j string ls_FileId string ls_FileName string ls_FileType string ls_FileContentType string ls_FileDescription string ls_FileCreatedAt string ls_FileUpdatedAt string ls_FileSha256 string ls_FileWorkspace string ls_FileCreator integer li_FileProtected integer li_FilePosition string ls_FileParent integer li_Page string ls_Position_str string ls_FieldName string ls_Mention string ls_Mention2 string ls_Reason integer k integer li_Count_k string ls_StrVal string ls_ContentType string ls_Sha256 integer li_V_protected string ls_Id string ls_Name string ls_Description string ls_CreatedAt string ls_UpdatedAt string ls_FinishedAt string ls_ExpiresAt string ls_Status string ls_Creator string ls_CreatorFirstName string ls_CreatorLastName string ls_Workspace integer li_Template integer li_Ordered string ls_Parent integer li_RelatedFilesEnable integer li_Archive 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 CURL command: // curl --location --request POST 'https://staging-api.yousign.com/procedures' \ // --header 'Authorization: Bearer YOUR_API_KEY' \ // --header 'Content-Type: application/json' \ // --data-raw '{ // "name": "My first procedure", // "description": "Awesome! Here is the description of my first procedure", // "members": [ // { // "firstname": "John", // "lastname": "Doe", // "email": "john.doe@yousign.fr", // "phone": "+33612345678", // "fileObjects": [ // { // "file": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "page": 2, // "position": "230,499,464,589", // "mention": "Read and approved", // "mention2": "Signed by John Doe" // } // ] // } // ] // }' // Use the following online tool to generate HTTP code from a CURL command // Convert a cURL Command to HTTP Source Code // Use this online tool to generate code from sample JSON: // Generate Code to Create JSON // The following JSON is sent in the request body. // { // "name": "My first procedure", // "description": "Awesome! Here is the description of my first procedure", // "members": [ // { // "firstname": "John", // "lastname": "Doe", // "email": "john.doe@yousign.fr", // "phone": "+33612345678", // "fileObjects": [ // { // "file": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "page": 2, // "position": "230,499,464,589", // "mention": "Read and approved", // "mention2": "Signed by John Doe" // } // ] // } // ] // } loo_Json = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") loo_Json.UpdateString("name","My first procedure") loo_Json.UpdateString("description","Awesome! Here is the description of my first procedure") loo_Json.UpdateString("members[0].firstname","John") loo_Json.UpdateString("members[0].lastname","Doe") loo_Json.UpdateString("members[0].email","john.doe@yousign.fr") loo_Json.UpdateString("members[0].phone","+33612345678") loo_Json.UpdateString("members[0].fileObjects[0].file","/files/6c123a8d-e5cf-4534-8da0-81886376ba2c") loo_Json.UpdateInt("members[0].fileObjects[0].page",2) loo_Json.UpdateString("members[0].fileObjects[0].position","230,499,464,589") loo_Json.UpdateString("members[0].fileObjects[0].mention","Read and approved") loo_Json.UpdateString("members[0].fileObjects[0].mention2","Signed by John Doe") // Adds the "Authorization: Bearer YOUR_API_KEY" header. loo_Http.AuthToken = "YOUR_API_KEY" loo_Http.SetRequestHeader("Content-Type","application/json") loo_Resp = loo_Http.PostJson3("https://staging-api.yousign.com/procedures","application/json",loo_Json) if loo_Http.LastMethodSuccess = 0 then Write-Debug loo_Http.LastErrorText destroy loo_Http destroy loo_Json return end if loo_SbResponseBody = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder") loo_Resp.GetBodySb(loo_SbResponseBody) 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_Resp.StatusCode Write-Debug "Response Status Code = " + string(li_RespStatusCode) if li_RespStatusCode >= 400 then Write-Debug "Response Header:" Write-Debug loo_Resp.Header Write-Debug "Failed." destroy loo_Resp destroy loo_Http destroy loo_Json destroy loo_SbResponseBody destroy loo_JResp return end if destroy loo_Resp // Sample JSON response: // (Sample code for parsing the JSON response is shown below) // { // "id": "/procedures/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "name": "My first procedure", // "description": "Awesome! Here is the description of my first procedure", // "createdAt": "2018-12-01T11:49:11+01:00", // "updatedAt": "2018-12-01T11:49:11+01:00", // "finishedAt": null, // "expiresAt": null, // "status": "active", // "creator": null, // "creatorFirstName": null, // "creatorLastName": null, // "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "template": false, // "ordered": false, // "parent": null, // "metadata": [ // ], // "config": [ // ], // "members": [ // { // "id": "/members/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "user": null, // "type": "signer", // "firstname": "John", // "lastname": "Doe", // "email": "john.doe@yousign.fr", // "phone": "+33612345678", // "position": 1, // "createdAt": "2018-12-01T11:49:11+01:00", // "updatedAt": "2018-12-01T11:49:11+01:00", // "finishedAt": null, // "status": "pending", // "fileObjects": [ // { // "id": "/file_objects/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "file": { // "id": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "name": "The best name for my file.pdf", // "type": "signable", // "contentType": "application/pdf", // "description": null, // "createdAt": "2018-12-01T11:36:20+01:00", // "updatedAt": "2018-12-01T11:49:11+01:00", // "sha256": "bb57ae2b2ca6ad0133a699350d1a6f6c8cdfde3cf872cf526585d306e4675cc2", // "metadata": [ // ], // "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "creator": null, // "protected": false, // "position": 0, // "parent": null // }, // "page": 2, // "position": "230,499,464,589", // "fieldName": null, // "mention": "Read and approved", // "mention2": "Signed by John Doe", // "createdAt": "2018-12-01T11:49:11+01:00", // "updatedAt": "2018-12-01T11:49:11+01:00", // "parent": null, // "reason": "Signed by Yousign" // } // ], // "comment": null, // "notificationsEmail": [ // ], // "operationLevel": "custom", // "operationCustomModes": [ // "sms" // ], // "operationModeSmsConfig": null, // "parent": null // } // ], // "subscribers": [ // ], // "files": [ // { // "id": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "name": "The best name for my file.pdf", // "type": "signable", // "contentType": "application/pdf", // "description": null, // "createdAt": "2018-12-01T11:36:20+01:00", // "updatedAt": "2018-12-01T11:49:11+01:00", // "sha256": "bb57ae2b2ca6ad0133a699350d1a6f6c8cdfde3cf872cf526585d306e4675cc2", // "metadata": [ // ], // "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX", // "creator": null, // "protected": false, // "position": 0, // "parent": null // } // ], // "relatedFilesEnable": false, // "archive": false, // "archiveMetadata": [ // ], // "fields": [ // ], // "permissions": [ // ] // } // 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_Id = loo_JResp.StringOf("id") ls_Name = loo_JResp.StringOf("name") ls_Description = loo_JResp.StringOf("description") ls_CreatedAt = loo_JResp.StringOf("createdAt") ls_UpdatedAt = loo_JResp.StringOf("updatedAt") ls_FinishedAt = loo_JResp.StringOf("finishedAt") ls_ExpiresAt = loo_JResp.StringOf("expiresAt") ls_Status = loo_JResp.StringOf("status") ls_Creator = loo_JResp.StringOf("creator") ls_CreatorFirstName = loo_JResp.StringOf("creatorFirstName") ls_CreatorLastName = loo_JResp.StringOf("creatorLastName") ls_Workspace = loo_JResp.StringOf("workspace") li_Template = loo_JResp.BoolOf("template") li_Ordered = loo_JResp.BoolOf("ordered") ls_Parent = loo_JResp.StringOf("parent") li_RelatedFilesEnable = loo_JResp.BoolOf("relatedFilesEnable") li_Archive = loo_JResp.BoolOf("archive") i = 0 li_Count_i = loo_JResp.SizeOfArray("metadata") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("config") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("members") do while i < li_Count_i loo_JResp.I = i ls_Id = loo_JResp.StringOf("members[i].id") ls_User = loo_JResp.StringOf("members[i].user") ls_V_type = loo_JResp.StringOf("members[i].type") ls_Firstname = loo_JResp.StringOf("members[i].firstname") ls_Lastname = loo_JResp.StringOf("members[i].lastname") ls_Email = loo_JResp.StringOf("members[i].email") ls_Phone = loo_JResp.StringOf("members[i].phone") li_Position = loo_JResp.IntOf("members[i].position") ls_CreatedAt = loo_JResp.StringOf("members[i].createdAt") ls_UpdatedAt = loo_JResp.StringOf("members[i].updatedAt") ls_FinishedAt = loo_JResp.StringOf("members[i].finishedAt") ls_Status = loo_JResp.StringOf("members[i].status") ls_Comment = loo_JResp.StringOf("members[i].comment") ls_OperationLevel = loo_JResp.StringOf("members[i].operationLevel") ls_OperationModeSmsConfig = loo_JResp.StringOf("members[i].operationModeSmsConfig") ls_Parent = loo_JResp.StringOf("members[i].parent") j = 0 li_Count_j = loo_JResp.SizeOfArray("members[i].fileObjects") do while j < li_Count_j loo_JResp.J = j ls_Id = loo_JResp.StringOf("members[i].fileObjects[j].id") ls_FileId = loo_JResp.StringOf("members[i].fileObjects[j].file.id") ls_FileName = loo_JResp.StringOf("members[i].fileObjects[j].file.name") ls_FileType = loo_JResp.StringOf("members[i].fileObjects[j].file.type") ls_FileContentType = loo_JResp.StringOf("members[i].fileObjects[j].file.contentType") ls_FileDescription = loo_JResp.StringOf("members[i].fileObjects[j].file.description") ls_FileCreatedAt = loo_JResp.StringOf("members[i].fileObjects[j].file.createdAt") ls_FileUpdatedAt = loo_JResp.StringOf("members[i].fileObjects[j].file.updatedAt") ls_FileSha256 = loo_JResp.StringOf("members[i].fileObjects[j].file.sha256") ls_FileWorkspace = loo_JResp.StringOf("members[i].fileObjects[j].file.workspace") ls_FileCreator = loo_JResp.StringOf("members[i].fileObjects[j].file.creator") li_FileProtected = loo_JResp.BoolOf("members[i].fileObjects[j].file.protected") li_FilePosition = loo_JResp.IntOf("members[i].fileObjects[j].file.position") ls_FileParent = loo_JResp.StringOf("members[i].fileObjects[j].file.parent") li_Page = loo_JResp.IntOf("members[i].fileObjects[j].page") ls_Position_str = loo_JResp.StringOf("members[i].fileObjects[j].position") ls_FieldName = loo_JResp.StringOf("members[i].fileObjects[j].fieldName") ls_Mention = loo_JResp.StringOf("members[i].fileObjects[j].mention") ls_Mention2 = loo_JResp.StringOf("members[i].fileObjects[j].mention2") ls_CreatedAt = loo_JResp.StringOf("members[i].fileObjects[j].createdAt") ls_UpdatedAt = loo_JResp.StringOf("members[i].fileObjects[j].updatedAt") ls_Parent = loo_JResp.StringOf("members[i].fileObjects[j].parent") ls_Reason = loo_JResp.StringOf("members[i].fileObjects[j].reason") k = 0 li_Count_k = loo_JResp.SizeOfArray("members[i].fileObjects[j].file.metadata") do while k < li_Count_k loo_JResp.K = k k = k + 1 loop j = j + 1 loop j = 0 li_Count_j = loo_JResp.SizeOfArray("members[i].notificationsEmail") do while j < li_Count_j loo_JResp.J = j j = j + 1 loop j = 0 li_Count_j = loo_JResp.SizeOfArray("members[i].operationCustomModes") do while j < li_Count_j loo_JResp.J = j ls_StrVal = loo_JResp.StringOf("members[i].operationCustomModes[j]") j = j + 1 loop i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("subscribers") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("files") do while i < li_Count_i loo_JResp.I = i ls_Id = loo_JResp.StringOf("files[i].id") ls_Name = loo_JResp.StringOf("files[i].name") ls_V_type = loo_JResp.StringOf("files[i].type") ls_ContentType = loo_JResp.StringOf("files[i].contentType") ls_Description = loo_JResp.StringOf("files[i].description") ls_CreatedAt = loo_JResp.StringOf("files[i].createdAt") ls_UpdatedAt = loo_JResp.StringOf("files[i].updatedAt") ls_Sha256 = loo_JResp.StringOf("files[i].sha256") ls_Workspace = loo_JResp.StringOf("files[i].workspace") ls_Creator = loo_JResp.StringOf("files[i].creator") li_V_protected = loo_JResp.BoolOf("files[i].protected") li_Position = loo_JResp.IntOf("files[i].position") ls_Parent = loo_JResp.StringOf("files[i].parent") j = 0 li_Count_j = loo_JResp.SizeOfArray("files[i].metadata") do while j < li_Count_j loo_JResp.J = j j = j + 1 loop i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("archiveMetadata") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("fields") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop i = 0 li_Count_i = loo_JResp.SizeOfArray("permissions") do while i < li_Count_i loo_JResp.I = i i = i + 1 loop destroy loo_Http destroy loo_Json destroy loo_SbResponseBody destroy loo_JResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.