Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Visual FoxPro Examples

Web API Categories

ASN.1
AWS KMS
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Key Vault
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Cloud Signature CSC
Code Signing
Compression
DKIM / DomainKey
DNS
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
EBICS
ECC
Ed25519
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
GMail SMTP/IMAP/POP
Geolocation
Google APIs
Google Calendar
Google Cloud SQL
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text
HTTP

HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
MS Storage Providers
Microsoft Graph
Misc
NTLM
OAuth1
OAuth2
OIDC
Office365
OneDrive
OpenSSL
Outlook
Outlook Calendar
Outlook Contact
PDF Signatures
PEM
PFX/P12
PKCS11
POP3
PRNG
REST
REST Misc
RSA
SCP
SCard
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
ScMinidriver
Secrets
SharePoint
SharePoint Online
Signing in the Cloud
Socket/SSL/TLS
Spider
Stream
Tar Archive
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl
uncategorized

 

 

 

(Visual FoxPro) Send DocuSign XML Request

Demonstrates how to send a DocuSign XML request.

Important:This example requires Chillkat v9.5.0.75 or greater.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loReq
LOCAL loXmlCred
LOCAL loXml
LOCAL loHttp
LOCAL loResp
LOCAL lcEnvelopeId
LOCAL lcStatus
LOCAL lcStatusDateTime
LOCAL lcUri

* This requires 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.HttpRequest')
loReq = CreateObject('Chilkat.HttpRequest')

loReq.HttpVerb = "POST"

* Replace "12999999" with your own account number. (12999999 is a ficticious account number)
loReq.Path = "/restapi/v2/accounts/12999999/envelopes"

loReq.AddHeader("Accept","application/xml")

* Don't worry about the boundary string.  Chilkat will automatically generate one and include it.
loReq.ContentType = "multipart/form-data"

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Xml')
loXmlCred = CreateObject('Chilkat.Xml')
loXmlCred.Tag = "DocuSignCredentials"
loXmlCred.UpdateChildContent("Username","YOUR_DOCUSIGN_USERNAME")
loXmlCred.UpdateChildContent("Password","YOUR_DOCUSIGN_PASSWORD")
loXmlCred.UpdateChildContent("IntegratorKey","ABCD-12345678-1234-AAAA-BBBB-abcdabcdabcd")
loXmlCred.EmitXmlDecl = 0
loXmlCred.EmitCompact = 1
loReq.AddHeader("X-DocuSign-Authentication",loXmlCred.GetXml())

* Don't worry about Host or Content-Length headers, Chilkat automatically adds them...

* Build the XML for the 1st body part..
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Xml')
loXml = CreateObject('Chilkat.Xml')
loXml.Tag = "envelopeDefinition"
loXml.AddAttribute("xmlns","http://www.docusign.com/restapi")
loXml.UpdateChildContent("emailSubject","Signature Request: Test Test:001019:033611")
loXml.UpdateChildContent("status","sent")
loXml.UpdateChildContent("documents|document|documentId","1")
loXml.UpdateChildContent("documents|document|name","001019_TestTest_RetailDeals_163357")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|hostEmail","admin@chilkatsoft.com")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|hostName","Chilkat Admin")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|signerName","Test  Test")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|recipientId","1")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|routingOrder","1")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|signerEmail","test@tyest.com")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|anchorString","\SDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|anchorString","\OSDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[1]|optional","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|anchorString","\OPSSDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|optional","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[2]|scaleValue","0.7")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|anchorString","\PSSDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|signHereTabs|signHere[3]|scaleValue","0.7")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|anchorString","\IDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|anchorString","\OIDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[1]|optional","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|anchorString","\OPSIDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|optional","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[2]|scaleValue","0.5")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|anchorString","\PSIDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner|tabs|initialHereTabs|initialHere[3]|scaleValue","0.5")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|hostEmail","admin@chilkatsoft.com")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|hostName","Chilkat Admin")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|signerName","Dealer Representative")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|recipientId","2")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|routingOrder","2")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|anchorString","\DSDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|anchorString","\DOSDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|signHereTabs|signHere[1]|optional","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|anchorString","\DIDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere|optional","False")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|anchorIgnoreIfNotPresent","True")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|anchorString","\DOIDP")
loXml.UpdateChildContent("recipients|inPersonSigners|inPersonSigner[1]|tabs|initialHereTabs|initialHere[1]|optional","True")
loXml.EmitXmlDecl = 0

? loXml.GetXml()

loXml.EmitCompact = 1

* IMPORTANT: This example requires Chilkat v9.5.0.75 or greater.
loReq.AddStringForUpload2("","",loXml.GetXml(),"utf-8","application/xml")
loReq.AddFileForUpload2("","qa_data/pdf/signatureForm.pdf","application/pdf")
loReq.AddSubHeader(1,"Content-Disposition",'file; filename="signatureForm.pdf";documentid=1')

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')

loHttp.SessionLogFilename = "qa_output/log.txt"

loResp = loHttp.SynchronousRequest("na2.docusign.net",443,1,loReq)
IF (loHttp.LastMethodSuccess <> 1) THEN
    ? loHttp.LastErrorText
    RELEASE loReq
    RELEASE loXmlCred
    RELEASE loXml
    RELEASE loHttp
    CANCEL
ENDIF

IF (loResp.StatusCode <> 201) THEN
    ? loResp.BodyStr
    ? "Response status code: " + STR(loResp.StatusCode)
    ? "Failed."
    RELEASE loResp
    RELEASE loReq
    RELEASE loXmlCred
    RELEASE loXml
    RELEASE loHttp
    CANCEL
ENDIF

* Examine the response..
loXml.LoadXml(loResp.BodyStr)
lcEnvelopeId = loXml.GetChildContent("envelopeId")
? "envelopeId = " + lcEnvelopeId
lcStatus = loXml.GetChildContent("status")
? "status = " + lcStatus
lcStatusDateTime = loXml.GetChildContent("statusDateTime")
? "statusDateTime = " + lcStatusDateTime
lcUri = loXml.GetChildContent("uri")
? "uri = " + lcUri

RELEASE loResp

RELEASE loReq
RELEASE loXmlCred
RELEASE loXml
RELEASE loHttp


 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.