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

DataFlex 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

 

 

 

(DataFlex) Adobe Analytics Reporting API (1.4)

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

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-win32.pkg

Procedure Test
    Boolean iSuccess
    String sUrl
    Handle hoJson
    Handle hoHttp
    Handle hoDt
    String sTimecreated
    Handle hoPrng
    String sNonce
    String sSecret
    Handle hoSb
    Handle hoCrypt
    String sDigest
    Handle hoSbNonce
    Variant vResp
    Handle hoResp
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

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

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End
    Get ComUpdateString Of hoJson "reportDescription.reportSuiteID" "rsid" To iSuccess
    Get ComUpdateString Of hoJson "reportDescription.dateGranularity" "hour" To iSuccess

    Get Create (RefClass(cComChilkatHttp)) To hoHttp
    If (Not(IsComObjectCreated(hoHttp))) Begin
        Send CreateComObject of hoHttp
    End

    Get Create (RefClass(cComCkDateTime)) To hoDt
    If (Not(IsComObjectCreated(hoDt))) Begin
        Send CreateComObject of hoDt
    End
    Get ComSetFromCurrentSystemTime Of hoDt To iSuccess
    Get ComGetAsTimestamp Of hoDt False To sTimecreated

    Get Create (RefClass(cComChilkatPrng)) To hoPrng
    If (Not(IsComObjectCreated(hoPrng))) Begin
        Send CreateComObject of hoPrng
    End
    Get ComGenRandom Of hoPrng 12 "hex" To sNonce

    Move "SECRET" To sSecret

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSb
    If (Not(IsComObjectCreated(hoSb))) Begin
        Send CreateComObject of hoSb
    End
    Get ComAppend Of hoSb sNonce To iSuccess
    Get ComAppend Of hoSb sTimecreated To iSuccess
    Get ComAppend Of hoSb sSecret To iSuccess

    Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt
    If (Not(IsComObjectCreated(hoCrypt))) Begin
        Send CreateComObject of hoCrypt
    End
    Set ComHashAlgorithm Of hoCrypt To "sha1"
    Set ComEncodingMode Of hoCrypt To "base64"
    Get ComGetAsString Of hoSb To sTemp1
    Get ComHashStringENC Of hoCrypt sTemp1 To sDigest

    Get Create (RefClass(cComChilkatStringBuilder)) To hoSbNonce
    If (Not(IsComObjectCreated(hoSbNonce))) Begin
        Send CreateComObject of hoSbNonce
    End
    Get ComAppend Of hoSbNonce sNonce To iSuccess
    Get ComEncode Of hoSbNonce "base64" To iSuccess

    Send ComClear To hoSb
    Get ComAppend Of hoSb 'UsernameToken Username="USERNAME", PasswordDigest="' To iSuccess
    Get ComAppend Of hoSb sDigest To iSuccess
    Get ComAppend Of hoSb '", Nonce="' To iSuccess
    Get ComGetAsString Of hoSbNonce To sTemp1
    Get ComAppend Of hoSb sTemp1 To iSuccess
    Get ComAppend Of hoSb '", Created="' To iSuccess
    Get ComAppend Of hoSb sTimecreated To iSuccess
    Get ComAppend Of hoSb '"' To iSuccess

    Get ComGetAsString Of hoSb To sTemp1
    Showln sTemp1

    Get ComGetAsString Of hoSb To sTemp1
    Send ComSetRequestHeader To hoHttp "X-WSSE" sTemp1

    Get ComEmit Of hoJson To sTemp1
    Get ComPostJson2 Of hoHttp sUrl "text/json" sTemp1 To vResp
    If (IsComObject(vResp)) Begin
        Get Create (RefClass(cComChilkatHttpResponse)) To hoResp
        Set pvComObject Of hoResp To vResp
    End
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 <> True) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComStatusCode Of hoResp To iTemp1
    Showln "Http Status code: " iTemp1
    Showln "JSON response:"
    Get ComBodyStr Of hoResp To sTemp1
    Showln sTemp1

    Send Destroy of hoResp


End_Procedure

 

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