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

Classic ASP 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
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun
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
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
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

 

 

 

(Classic ASP) Ibanity XS2A List Financial Institutions

See more Ibanity Examples

Demonstrates how to send a request to get a list of financial institutions.

For more information, see https://documentation.ibanity.com/xs2a/api/curl#authentication

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<%
' This example requires the Chilkat API to have been previously unlocked.
' See Global Unlock Sample for sample code.

'  Send the following request:

' $ curl -X GET https://api.ibanity.com/xs2a/financial-institutions \
' --cert certificate.pem \
' --key private_key.pem \
' -H 'Signature: keyId="75b5d796-de5c-400a-81ce-e72371b01cbc",created=1599659223,algorithm="hs2019",headers="(request-target) digest (created) host",signature="BASE64(RSA-SHA256(SIGNING_STRING))"' \
' -H 'Digest: SHA-512=beDaRguyEb8fhh5wnl37bOTDtvhuYZyZNkTZ9LiC9Wc='

' Ibanity provides the certificate + private key in PFX format.  This example will use the .pfx instead of the pair of PEM files.
' (It is also possible to implement using Chilkat with the PEM files, but PFX is easier.)
set cert = Server.CreateObject("Chilkat_9_5_0.Cert")
success = cert.LoadPfxFile("qa_data/pfx/my_ibanity_certificate.pfx","my_pfx_password")
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( cert.LastErrorText) & "</pre>"
    Response.End
End If

' We need to calculate the Digest and Signature header fields.
' For a detailed explanation, see Calculate Ibanity HTTP Signature Example

' We'll just write the code here as briefly as possible.

set dtNow = Server.CreateObject("Chilkat_9_5_0.CkDateTime")
success = dtNow.SetFromCurrentSystemTime()
created = dtNow.GetAsUnixTimeStr(0)

set crypt2 = Server.CreateObject("Chilkat_9_5_0.Crypt2")
crypt2.HashAlgorithm = "sha512"
crypt2.EncodingMode = "base64"

set sbDigestHdrValue = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = sbDigestHdrValue.Append("SHA-512=")
' GET requests have empty payloads.  The SHA-512 hash of the empty string is the same for all GET requests.
' Therefore all GET requests will use "z4PhNX7vuL3xVChQ1m2AB9Yg5AULVxXcg/SpIdNs6c5H0NE8XYXysP+DGNKHfuwvY7kxvUdBeoGlODJ6+SfaPg=="
' You can eliminate the explicit hash computation (for GET requests) and simply use the above literal string.
success = sbDigestHdrValue.Append(crypt2.HashStringENC(""))

Response.Write "<pre>" & Server.HTMLEncode( "Generated Digest") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( sbDigestHdrValue.GetAsString()) & "</pre>"

request_target = "get /xs2a/financial-institutions"

set sbSigningString = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = sbSigningString.Append("(request-target): ")
success = sbSigningString.AppendLine(request_target,0)
success = sbSigningString.Append("host: ")
success = sbSigningString.AppendLine("api.ibanity.com",0)
success = sbSigningString.Append("digest: ")
success = sbSigningString.AppendLine(sbDigestHdrValue.GetAsString(),0)
success = sbSigningString.Append("(created): ")
success = sbSigningString.Append(created)
' ibanity-idempotency-key is not used with GET requests.

Response.Write "<pre>" & Server.HTMLEncode( "Signing String:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( sbSigningString.GetAsString()) & "</pre>"

signed_headers_list = "(request-target) host digest (created)"

set privKey = Server.CreateObject("Chilkat_9_5_0.PrivateKey")
success = privKey.LoadEncryptedPemFile("my_ibanity_signature_private_key.pem","pem_password")
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( privKey.LastErrorText) & "</pre>"
    Response.End
End If

set rsa = Server.CreateObject("Chilkat_9_5_0.Rsa")
rsa.PssSaltLen = 32
rsa.EncodingMode = "base64"
' Use the RSASSA-PSS signature algorithm
rsa.OaepPadding = 1

success = rsa.ImportPrivateKeyObj(privKey)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( rsa.LastErrorText) & "</pre>"
    Response.End
End If

' Sign the signing string.
sigBase64 = rsa.SignStringENC(sbSigningString.GetAsString(),"sha-256")
If (rsa.LastMethodSuccess = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( rsa.LastErrorText) & "</pre>"
    Response.End
End If

Response.Write "<pre>" & Server.HTMLEncode( "Signature:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( sigBase64) & "</pre>"

' Build the signature header value.
set sbSigHeaderValue = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = sbSigHeaderValue.Append("keyId=""")
' Use your identifier for the application's signature certificate, obtained from the Developer Portal
success = sbSigHeaderValue.Append("a0ce296d-84c8-4bd5-8eb4-de0339950cfa")
success = sbSigHeaderValue.Append(""",created=")
success = sbSigHeaderValue.Append(created)
success = sbSigHeaderValue.Append(",algorithm=""hs2019"",headers=""")
success = sbSigHeaderValue.Append(signed_headers_list)
success = sbSigHeaderValue.Append(""",signature=""")
success = sbSigHeaderValue.Append(sigBase64)
success = sbSigHeaderValue.Append("""")

' Send the GET request..
set http = Server.CreateObject("Chilkat_9_5_0.Http")

success = http.SetSslClientCert(cert)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

http.SetRequestHeader "Signature",sbSigHeaderValue.GetAsString()
http.SetRequestHeader "Digest",sbDigestHdrValue.GetAsString()

set sbResponseBody = Server.CreateObject("Chilkat_9_5_0.StringBuilder")
success = http.QuickGetSb("https://api.ibanity.com/xs2a/financial-institutions",sbResponseBody)
If (success = 0) Then
    Response.Write "<pre>" & Server.HTMLEncode( http.LastErrorText) & "</pre>"
    Response.End
End If

set jResp = Server.CreateObject("Chilkat_9_5_0.JsonObject")
success = jResp.LoadSb(sbResponseBody)
jResp.EmitCompact = 0

Response.Write "<pre>" & Server.HTMLEncode( "Response Body:") & "</pre>"
Response.Write "<pre>" & Server.HTMLEncode( jResp.Emit()) & "</pre>"

respStatusCode = http.LastStatus
Response.Write "<pre>" & Server.HTMLEncode( "Response Status Code = " & respStatusCode) & "</pre>"
If (respStatusCode >= 400) Then
    Response.Write "<pre>" & Server.HTMLEncode( "Response Header:") & "</pre>"
    Response.Write "<pre>" & Server.HTMLEncode( http.LastHeader) & "</pre>"
    Response.Write "<pre>" & Server.HTMLEncode( "Failed.") & "</pre>"
    Response.End
End If

' Sample output:
' (Sample code for parsing the JSON response is shown below)

' {
'   "data": [
'     {
'       "attributes": {
'         "authorizationModels": [
'           "detailed",
'           "financialInstitutionOffered"
'         ],
'         "bic": "NBBEBEBB203",
'         "bulkPaymentsEnabled": true,
'         "bulkPaymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "country": null,
'         "financialInstitutionCustomerReferenceRequired": false,
'         "futureDatedPaymentsAllowed": true,
'         "logoUrl": "https://s3.eu-central-1.amazonaws.com/ibanity-production-financial-institution-assets/sandbox.png",
'         "maintenanceFrom": null,
'         "maintenanceTo": null,
'         "maintenanceType": null,
'         "maxRequestedAccountReferences": null,
'         "minRequestedAccountReferences": 0,
'         "name": "Bogus Financial",
'         "paymentsEnabled": true,
'         "paymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "periodicPaymentsEnabled": true,
'         "periodicPaymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "primaryColor": "#7d39ff",
'         "requiresCredentialStorage": false,
'         "requiresCustomerIpAddress": false,
'         "sandbox": true,
'         "secondaryColor": "#3DF2C2",
'         "sharedBrandName": null,
'         "sharedBrandReference": null,
'         "status": "beta"
'       },
'       "id": "2d3d70a4-cb3c-477c-97e1-cbe495b82841",
'       "links": {
'         "self": "https://api.ibanity.com/xs2a/financial-institutions/2d3d70a4-cb3c-477c-97e1-cbe495b82841"
'       },
'       "type": "financialInstitution"
'     },
'     {
'       "attributes": {
'         "authorizationModels": [
'           "detailed",
'           "financialInstitutionOffered"
'         ],
'         "bic": "NBBEBEBB203",
'         "bulkPaymentsEnabled": true,
'         "bulkPaymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "country": null,
'         "financialInstitutionCustomerReferenceRequired": false,
'         "futureDatedPaymentsAllowed": true,
'         "logoUrl": "https://s3.eu-central-1.amazonaws.com/ibanity-production-financial-institution-assets/sandbox.png",
'         "maintenanceFrom": null,
'         "maintenanceTo": null,
'         "maintenanceType": null,
'         "maxRequestedAccountReferences": null,
'         "minRequestedAccountReferences": 0,
'         "name": "XYZ Trust",
'         "paymentsEnabled": true,
'         "paymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "periodicPaymentsEnabled": true,
'         "periodicPaymentsProductTypes": [
'           "sepaCreditTransfer"
'         ],
'         "primaryColor": "#7d39ff",
'         "requiresCredentialStorage": false,
'         "requiresCustomerIpAddress": false,
'         "sandbox": true,
'         "secondaryColor": "#3DF2C2",
'         "sharedBrandName": null,
'         "sharedBrandReference": null,
'         "status": "beta"
'       },
'       "id": "d4100f28-936b-4379-a3f8-86314a2014fb",
'       "links": {
'         "self": "https://api.ibanity.com/xs2a/financial-institutions/d4100f28-936b-4379-a3f8-86314a2014fb"
'       },
'       "type": "financialInstitution"
'     }
'   ],
'   "links": {
'     "first": "https://api.ibanity.com/xs2a/financial-institutions"
'   },
'   "meta": {
'     "paging": {
'       "limit": 10
'     }
'   }
' }

' Sample code for parsing the JSON response...
' Use the following online tool to generate parsing code from sample JSON:
' Generate Parsing Code from JSON

linksFirst = jResp.StringOf("links.first")
metaPagingLimit = jResp.IntOf("meta.paging.limit")
i = 0
count_i = jResp.SizeOfArray("data")
Do While i < count_i
    jResp.I = i
    attributesBic = jResp.StringOf("data[i].attributes.bic")
    attributesBulkPaymentsEnabled = jResp.BoolOf("data[i].attributes.bulkPaymentsEnabled")
    attributesCountry = jResp.StringOf("data[i].attributes.country")
    attributesFinancialInstitutionCustomerReferenceRequired = jResp.BoolOf("data[i].attributes.financialInstitutionCustomerReferenceRequired")
    attributesFutureDatedPaymentsAllowed = jResp.BoolOf("data[i].attributes.futureDatedPaymentsAllowed")
    attributesLogoUrl = jResp.StringOf("data[i].attributes.logoUrl")
    attributesMaintenanceFrom = jResp.StringOf("data[i].attributes.maintenanceFrom")
    attributesMaintenanceTo = jResp.StringOf("data[i].attributes.maintenanceTo")
    attributesMaintenanceType = jResp.StringOf("data[i].attributes.maintenanceType")
    attributesMaxRequestedAccountReferences = jResp.StringOf("data[i].attributes.maxRequestedAccountReferences")
    attributesMinRequestedAccountReferences = jResp.IntOf("data[i].attributes.minRequestedAccountReferences")
    attributesName = jResp.StringOf("data[i].attributes.name")
    attributesPaymentsEnabled = jResp.BoolOf("data[i].attributes.paymentsEnabled")
    attributesPeriodicPaymentsEnabled = jResp.BoolOf("data[i].attributes.periodicPaymentsEnabled")
    attributesPrimaryColor = jResp.StringOf("data[i].attributes.primaryColor")
    attributesRequiresCredentialStorage = jResp.BoolOf("data[i].attributes.requiresCredentialStorage")
    attributesRequiresCustomerIpAddress = jResp.BoolOf("data[i].attributes.requiresCustomerIpAddress")
    attributesSandbox = jResp.BoolOf("data[i].attributes.sandbox")
    attributesSecondaryColor = jResp.StringOf("data[i].attributes.secondaryColor")
    attributesSharedBrandName = jResp.StringOf("data[i].attributes.sharedBrandName")
    attributesSharedBrandReference = jResp.StringOf("data[i].attributes.sharedBrandReference")
    attributesStatus = jResp.StringOf("data[i].attributes.status")
    id = jResp.StringOf("data[i].id")
    linksSelf = jResp.StringOf("data[i].links.self")
    v_type = jResp.StringOf("data[i].type")
    j = 0
    count_j = jResp.SizeOfArray("data[i].attributes.authorizationModels")
    Do While j < count_j
        jResp.J = j
        strVal = jResp.StringOf("data[i].attributes.authorizationModels[j]")
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("data[i].attributes.bulkPaymentsProductTypes")
    Do While j < count_j
        jResp.J = j
        strVal = jResp.StringOf("data[i].attributes.bulkPaymentsProductTypes[j]")
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("data[i].attributes.paymentsProductTypes")
    Do While j < count_j
        jResp.J = j
        strVal = jResp.StringOf("data[i].attributes.paymentsProductTypes[j]")
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("data[i].attributes.periodicPaymentsProductTypes")
    Do While j < count_j
        jResp.J = j
        strVal = jResp.StringOf("data[i].attributes.periodicPaymentsProductTypes[j]")
        j = j + 1
    Loop
    i = i + 1
Loop

%>
</body>
</html>

 

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