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

Xojo Plugin Examples

Web API Categories

ASN.1
AWS Misc
Amazon EC2
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
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
ULID/UUID
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(Xojo Plugin) Adobe Analytics Reporting API (1.4)

Demonstrates a simple POST of JSON to the Adobe Analytics Reporting API (v1.4)

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM

//  This requires the Chilkat API to have been previously unlocked.
//  See Global Unlock Sample for sample code.
Dim success As Boolean

//  In this example, replace "rsid" with your report suite id, and update the URL to use the correct endpoint
Dim url As String
url = "https://api.omniture.com/admin/1.4/rest/?method=Report.Queue"

Dim json As New Chilkat.JsonObject
success = json.UpdateString("reportDescription.reportSuiteID","rsid")
success = json.UpdateString("reportDescription.dateGranularity","hour")

Dim http As New Chilkat.Http

Dim dt As New Chilkat.CkDateTime
success = dt.SetFromCurrentSystemTime()
Dim timecreated As String
timecreated = dt.GetAsTimestamp(False)

Dim prng As New Chilkat.Prng
Dim nonce As String
nonce = prng.GenRandom(12,"hex")

Dim secret As String
secret = "SECRET"

Dim sb As New Chilkat.StringBuilder
success = sb.Append(nonce)
success = sb.Append(timecreated)
success = sb.Append(secret)

Dim crypt As New Chilkat.Crypt2
crypt.HashAlgorithm = "sha1"
crypt.EncodingMode = "base64"
Dim digest As String
digest = crypt.HashStringENC(sb.GetAsString())

Dim sbNonce As New Chilkat.StringBuilder
success = sbNonce.Append(nonce)
success = sbNonce.Encode("base64")

sb.Clear 
success = sb.Append("UsernameToken Username=""USERNAME"", PasswordDigest=""")
success = sb.Append(digest)
success = sb.Append(""", Nonce=""")
success = sb.Append(sbNonce.GetAsString())
success = sb.Append(""", Created=""")
success = sb.Append(timecreated)
success = sb.Append("""")

System.DebugLog(sb.GetAsString())

http.SetRequestHeader "X-WSSE",sb.GetAsString()

Dim resp As Chilkat.HttpResponse
resp = http.PostJson2(url,"text/json",json.Emit())
If (http.LastMethodSuccess <> True) Then
    System.DebugLog(http.LastErrorText)
    Return
End If

System.DebugLog("Http Status code: " + Str(resp.StatusCode))
System.DebugLog("JSON response:")
System.DebugLog(resp.BodyStr)


 

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