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) Send DocuSign XML RequestDemonstrates how to send a DocuSign XML request. Important:This example requires Chillkat v9.5.0.75 or greater.
; This requires the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oReq = ObjCreate("Chilkat.HttpRequest") $oReq.HttpVerb = "POST" ; Replace "12999999" with your own account number. (12999999 is a ficticious account number) $oReq.Path = "/restapi/v2/accounts/12999999/envelopes" $oReq.AddHeader "Accept","application/xml" ; Don't worry about the boundary string. Chilkat will automatically generate one and include it. $oReq.ContentType = "multipart/form-data" $oXmlCred = ObjCreate("Chilkat.Xml") $oXmlCred.Tag = "DocuSignCredentials" $oXmlCred.UpdateChildContent "Username","YOUR_DOCUSIGN_USERNAME" $oXmlCred.UpdateChildContent "Password","YOUR_DOCUSIGN_PASSWORD" $oXmlCred.UpdateChildContent "IntegratorKey","ABCD-12345678-1234-AAAA-BBBB-abcdabcdabcd" $oXmlCred.EmitXmlDecl = False $oXmlCred.EmitCompact = True $oReq.AddHeader "X-DocuSign-Authentication",$oXmlCred.GetXml() ; Don't worry about Host or Content-Length headers, Chilkat automatically adds them... ; Build the XML for the 1st body part.. $oXml = ObjCreate("Chilkat.Xml") $oXml.Tag = "envelopeDefinition" $oXml.AddAttribute("xmlns","http://www.docusign.com/restapi") $oXml.UpdateChildContent "emailSubject","Signature Request: Test Test:001019:033611" $oXml.UpdateChildContent "status","sent" $oXml.UpdateChildContent "documents|document|documentId","1" $oXml.UpdateChildContent "documents|document|name","001019_TestTest_RetailDeals_163357" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|hostEmail","admin@chilkatsoft.com" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|hostName","Chilkat Admin" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|signerName","Test Test" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|recipientId","1" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|routingOrder","1" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|signerEmail","test@tyest.com" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|anchorString","\SDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|anchorString","\OSDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|optional","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|anchorString","\OPSSDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|optional","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|scaleValue","0.7" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|anchorString","\PSSDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|scaleValue","0.7" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|anchorString","\IDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|anchorString","\OIDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|optional","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|anchorString","\OPSIDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|optional","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|scaleValue","0.5" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|anchorString","\PSIDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|scaleValue","0.5" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|hostEmail","admin@chilkatsoft.com" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|hostName","Chilkat Admin" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|signerName","Dealer Representative" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|recipientId","2" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|routingOrder","2" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|anchorString","\DSDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|anchorString","\DOSDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|optional","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|anchorString","\DIDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|optional","False" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|anchorIgnoreIfNotPresent","True" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|anchorString","\DOIDP" $oXml.UpdateChildContent "recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|optional","True" $oXml.EmitXmlDecl = False ConsoleWrite($oXml.GetXml() & @CRLF) $oXml.EmitCompact = True ; IMPORTANT: This example requires Chilkat v9.5.0.75 or greater. $oReq.AddStringForUpload2("","",$oXml.GetXml(),"utf-8","application/xml") $oReq.AddFileForUpload2("","qa_data/pdf/signatureForm.pdf","application/pdf") $oReq.AddSubHeader(1,"Content-Disposition","file; filename=""signatureForm.pdf"";documentid=1") $oHttp = ObjCreate("Chilkat.Http") $oHttp.SessionLogFilename = "qa_output/log.txt" Local $oResp = $oHttp.SynchronousRequest("na2.docusign.net",443,True,$oReq) If ($oHttp.LastMethodSuccess <> True) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf If ($oResp.StatusCode <> 201) Then ConsoleWrite($oResp.BodyStr & @CRLF) ConsoleWrite("Response status code: " & $oResp.StatusCode & @CRLF) ConsoleWrite("Failed." & @CRLF) Exit EndIf ; Examine the response.. $oXml.LoadXml($oResp.BodyStr) Local $sEnvelopeId = $oXml.GetChildContent("envelopeId") ConsoleWrite("envelopeId = " & $sEnvelopeId & @CRLF) Local $status = $oXml.GetChildContent("status") ConsoleWrite("status = " & $status & @CRLF) Local $statusDateTime = $oXml.GetChildContent("statusDateTime") ConsoleWrite("statusDateTime = " & $statusDateTime & @CRLF) Local $sUri = $oXml.GetChildContent("uri") ConsoleWrite("uri = " & $sUri & @CRLF) |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.