Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

VB.NET UWP/WinRT Examples

Web API Categories

ASN.1
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Azure Cloud Storage
Azure Service Bus
Azure Table Service
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
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
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
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(VB.NET UWP/WinRT) Send DocuSign XML Request

Demonstrates how to send a DocuSign XML request.

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

Chilkat Universal Windows Platform (UWP) / WinRT Downloads

Chilkat for the Universal Windows Platform (UWP)

'  This requires the Chilkat API to have been previously unlocked.
'  See Global Unlock Sample for sample code.

Dim req As New Chilkat.HttpRequest

req.HttpVerb = "POST"

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

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

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

Dim xmlCred As New Chilkat.Xml
xmlCred.Tag = "DocuSignCredentials"
xmlCred.UpdateChildContent("Username","YOUR_DOCUSIGN_USERNAME")
xmlCred.UpdateChildContent("Password","YOUR_DOCUSIGN_PASSWORD")
xmlCred.UpdateChildContent("IntegratorKey","ABCD-12345678-1234-AAAA-BBBB-abcdabcdabcd")
xmlCred.EmitXmlDecl = False
xmlCred.EmitCompact = True
req.AddHeader("X-DocuSign-Authentication",xmlCred.GetXml())

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


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

Debug.WriteLine(xml.GetXml())

xml.EmitCompact = True

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


Dim http As New Chilkat.Http

http.SessionLogFilename = "qa_output/log.txt"

Dim resp As Chilkat.HttpResponse = Await http.SynchronousRequestAsync("na2.docusign.net",443,True,req)
If (http.LastMethodSuccess <> True) Then
    Debug.WriteLine(http.LastErrorText)
    Exit Sub
End If


If (resp.StatusCode <> 201) Then
    Debug.WriteLine(resp.BodyStr)
    Debug.WriteLine("Response status code: " & resp.StatusCode)
    Debug.WriteLine("Failed.")

    Exit Sub
End If


'  Examine the response..
xml.LoadXml(resp.BodyStr)
Dim envelopeId As String = xml.GetChildContent("envelopeId")
Debug.WriteLine("envelopeId = " & envelopeId)
Dim status As String = xml.GetChildContent("status")
Debug.WriteLine("status = " & status)
Dim statusDateTime As String = xml.GetChildContent("statusDateTime")
Debug.WriteLine("statusDateTime = " & statusDateTime)
Dim uri As String = xml.GetChildContent("uri")
Debug.WriteLine("uri = " & uri)




 

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