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

Visual Basic 6.0 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
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

 

 

 

(Visual Basic 6.0) AbuseIPDB Check Endpoint

The check endpoint accepts a single IP address (v4 or v6). Optionally you may set the maxAgeInDays parameter to only return reports within the last x amount of days.

For more information, see https://docs.abuseipdb.com/?shell#check-endpoint

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

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

Dim http As New ChilkatHttp
Dim success As Long

' Implements the following CURL command:

' curl -G https://api.abuseipdb.com/api/v2/check \
'   --data-urlencode "ipAddress=118.25.6.39" \
'   -d maxAgeInDays=90 \
'   -d verbose \
'   -H "Key: $YOUR_API_KEY" \
'   -H "Accept: application/json"

' Use the following online tool to generate HTTP code from a CURL command
' Convert a cURL Command to HTTP Source Code

Dim req As New ChilkatHttpRequest
req.HttpVerb = "GET"
req.Path = "/api/v2/check"
req.ContentType = "application/x-www-form-urlencoded"
req.AddParam "maxAgeInDays","90"
req.AddParam "verbose",""
req.AddParam "ipAddress","118.25.6.39"

req.AddHeader "Key","$YOUR_API_KEY"
req.AddHeader "Accept","application/json"

Dim resp As ChilkatHttpResponse
Set resp = http.SynchronousRequest("api.abuseipdb.com",443,1,req)
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Dim jResp As New ChilkatJsonObject
success = jResp.Load(resp.BodyStr)
jResp.EmitCompact = 0

Debug.Print "Response Body:"
Debug.Print jResp.Emit()

Dim respStatusCode As Long
respStatusCode = resp.StatusCode
Debug.Print "Response Status Code = " & respStatusCode
If (respStatusCode >= 400) Then
    Debug.Print "Response Header:"
    Debug.Print resp.Header
    Debug.Print "Failed."

    Exit Sub
End If

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

' {
'   "data": {
'     "ipAddress": "118.25.6.39",
'     "isPublic": true,
'     "ipVersion": 4,
'     "isWhitelisted": false,
'     "abuseConfidenceScore": 1,
'     "countryCode": "CN",
'     "usageType": "Data Center\/Web Hosting\/Transit",
'     "isp": "Tencent Cloud Computing (Beijing) Co. Ltd",
'     "domain": "tencent.com",
'     "hostnames": [
'     ],
'     "countryName": "China",
'     "totalReports": 2,
'     "numDistinctUsers": 1,
'     "lastReportedAt": "2021-04-03T18:55:00+00:00",
'     "reports": [
'       {
'         "reportedAt": "2021-03-10T10:07:53+00:00",
'         "comment": "SSH login attempts with user root.",
'         "categories": [
'           18,
'           22
'         ],
'         "reporterId": 54484,
'         "reporterCountryCode": "CN",
'         "reporterCountryName": "China"
'       },
'       {
'         "reportedAt": "2021-03-09T09:47:57+00:00",
'         "comment": "SSH login attempts with user root.",
'         "categories": [
'           18,
'           22
'         ],
'         "reporterId": 54484,
'         "reporterCountryCode": "CN",
'         "reporterCountryName": "China"
'       }
'     ]
'   }
' }

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

Dim reportedAt As String
Dim comment As String
Dim reporterId As Long
Dim reporterCountryCode As String
Dim reporterCountryName As String
Dim j As Long
Dim count_j As Long
Dim intVal As Long

Dim dataIpAddress As String
dataIpAddress = jResp.StringOf("data.ipAddress")
Dim dataIsPublic As Long
dataIsPublic = jResp.BoolOf("data.isPublic")
Dim dataIpVersion As Long
dataIpVersion = jResp.IntOf("data.ipVersion")
Dim dataIsWhitelisted As Long
dataIsWhitelisted = jResp.BoolOf("data.isWhitelisted")
Dim dataAbuseConfidenceScore As Long
dataAbuseConfidenceScore = jResp.IntOf("data.abuseConfidenceScore")
Dim dataCountryCode As String
dataCountryCode = jResp.StringOf("data.countryCode")
Dim dataUsageType As String
dataUsageType = jResp.StringOf("data.usageType")
Dim dataIsp As String
dataIsp = jResp.StringOf("data.isp")
Dim dataDomain As String
dataDomain = jResp.StringOf("data.domain")
Dim dataCountryName As String
dataCountryName = jResp.StringOf("data.countryName")
Dim dataTotalReports As Long
dataTotalReports = jResp.IntOf("data.totalReports")
Dim dataNumDistinctUsers As Long
dataNumDistinctUsers = jResp.IntOf("data.numDistinctUsers")
Dim dataLastReportedAt As String
dataLastReportedAt = jResp.StringOf("data.lastReportedAt")
Dim i As Long
i = 0
Dim count_i As Long
count_i = jResp.SizeOfArray("data.hostnames")
Do While i < count_i
    jResp.I = i
    i = i + 1
Loop
i = 0
count_i = jResp.SizeOfArray("data.reports")
Do While i < count_i
    jResp.I = i
    reportedAt = jResp.StringOf("data.reports[i].reportedAt")
    comment = jResp.StringOf("data.reports[i].comment")
    reporterId = jResp.IntOf("data.reports[i].reporterId")
    reporterCountryCode = jResp.StringOf("data.reports[i].reporterCountryCode")
    reporterCountryName = jResp.StringOf("data.reports[i].reporterCountryName")
    j = 0
    count_j = jResp.SizeOfArray("data.reports[i].categories")
    Do While j < count_j
        jResp.J = j
        intVal = jResp.IntOf("data.reports[i].categories[j]")
        j = j + 1
    Loop
    i = i + 1
Loop

 

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