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

PowerBuilder Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(PowerBuilder) effectconnect Read Orderlist

Get a set of orders filtered by the parameters in the XML payload.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
integer li_Success
string ls_FullUri
string ls_Uri
string ls_ApiVersion
oleobject loo_Http
oleobject loo_Dt
string ls_Timestamp
oleobject loo_Xml
oleobject loo_SbXml
oleobject loo_SbStringToSign
oleobject loo_Crypt
oleobject loo_Resp
oleobject loo_XmlResp

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

ls_FullUri = "https://submit.effectconnect.com/orderlist"
ls_Uri = "/orderlist"
ls_ApiVersion = "2.0"

loo_Http = create oleobject
// Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// Use your effectconnect public key here..
loo_Http.SetRequestHeader("KEY","PUBLIC_KEY")
loo_Http.SetRequestHeader("VERSION",ls_ApiVersion)
loo_Http.SetRequestHeader("URI",ls_Uri)
loo_Http.SetRequestHeader("RESPONSETYPE","XML")
loo_Http.SetRequestHeader("RESPONSELANGUAGE","en")

// Get the current date/time in timestamp format.
loo_Dt = create oleobject
// Use "Chilkat_9_5_0.CkDateTime" for versions of Chilkat < 10.0.0
li_rc = loo_Dt.ConnectToNewObject("Chilkat.CkDateTime")

loo_Dt.SetFromCurrentSystemTime()
ls_Timestamp = loo_Dt.GetAsTimestamp(1)

loo_Http.SetRequestHeader("TIME",ls_Timestamp)
Write-Debug "timestamp = " + ls_Timestamp

// Create the following XML request body:
// <?xml version="1.0" encoding="utf-8"?>
// <list>
//   <filters>
//     <fromDateFilter>
//       <filterValue>2018-09-14T12:12:12+01:00</filterValue>
//     </fromDateFilter>
//     <toDateFilter>
//       <filterValue>2019-04-13T23:59:59+01:00</filterValue>
//     </toDateFilter>
//     <hasStatusFilter>
//       <filterValue>paid</filterValue>
//     </hasStatusFilter>
//     <hasTagFilter>
//       <filterValue>
//         <tagName>Test</tagName>
//         <exclude>false</exclude>
//       </filterValue>
//     </hasTagFilter>
//   </filters>
// </list>

// Use this online tool to generate the code from sample XML: 
// Generate Code to Create XML

loo_Xml = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
li_rc = loo_Xml.ConnectToNewObject("Chilkat.Xml")

loo_Xml.Tag = "list"
loo_Xml.UpdateChildContent("filters|fromDateFilter|filterValue","2018-09-14T12:12:12+01:00")
loo_Xml.UpdateChildContent("filters|toDateFilter|filterValue","2019-04-13T23:59:59+01:00")
loo_Xml.UpdateChildContent("filters|hasStatusFilter|filterValue","paid")
loo_Xml.UpdateChildContent("filters|hasTagFilter|filterValue|tagName","Test")
loo_Xml.UpdateChildContent("filters|hasTagFilter|filterValue|exclude","false")
loo_Xml.EmitCompact = 1

loo_SbXml = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbXml.ConnectToNewObject("Chilkat.StringBuilder")

loo_Xml.GetXmlSb(loo_SbXml)

// Build a string-to-sign and sign it using our effectconnect private key
loo_SbStringToSign = create oleobject
// Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
li_rc = loo_SbStringToSign.ConnectToNewObject("Chilkat.StringBuilder")

loo_SbStringToSign.AppendInt(loo_SbXml.Length)
loo_SbStringToSign.Append("POST")
loo_SbStringToSign.Append(ls_Uri)
loo_SbStringToSign.Append(ls_ApiVersion)
loo_SbStringToSign.Append(ls_Timestamp)

loo_Crypt = create oleobject
// Use "Chilkat_9_5_0.Crypt2" for versions of Chilkat < 10.0.0
li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2")

loo_Crypt.MacAlgorithm = "hmac"
loo_Crypt.HashAlgorithm = "sha512"
loo_Crypt.EncodingMode = "base64"
// Use your effectconnect private key here:
loo_Crypt.SetMacKeyString("PRIVATE_KEY")
loo_Http.SetRequestHeader("SIGNATURE",loo_Crypt.MacStringENC(loo_SbStringToSign.GetAsString()))

// Send the POST..
loo_Resp = loo_Http.PostXml(ls_FullUri,loo_Xml.GetXml(),"utf-8")
if loo_Http.LastMethodSuccess = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Dt
    destroy loo_Xml
    destroy loo_SbXml
    destroy loo_SbStringToSign
    destroy loo_Crypt
    return
end if

Write-Debug "response status code = " + string(loo_Resp.StatusCode)

// Examine the response.  The response status code can be 200 for both errors and success.
// The success or error is based on the XML returned in the response body.
loo_XmlResp = create oleobject
// Use "Chilkat_9_5_0.Xml" for versions of Chilkat < 10.0.0
li_rc = loo_XmlResp.ConnectToNewObject("Chilkat.Xml")

loo_XmlResp.LoadXml(loo_Resp.BodyStr)
destroy loo_Resp

Write-Debug "response body:"
Write-Debug loo_XmlResp.GetXml()

// Remove previously set headers (unless we want the same headers for the next request,
// in which case we may remove or update individual headers by calling SetRequestHeader.
loo_Http.ClearHeaders()


destroy loo_Http
destroy loo_Dt
destroy loo_Xml
destroy loo_SbXml
destroy loo_SbStringToSign
destroy loo_Crypt
destroy loo_XmlResp

 

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