Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Visual Basic 6.0 Web API Examples

Primary Categories

ABN AMRO
AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Global Payments
Google Search Console
Hungary NAV Invoicing
Jira
MYOB
Magento
MercadoLibre

Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
Rabobank
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twilio
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
WhatsApp
WooCommerce
Xero
Yousign
_Miscellaneous_
eBay
effectconnect

 

 

 

(Visual Basic 6.0) Azure List Storage Accounts

Demonstrates how to list Azure storage accounts.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

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

Dim http As New ChilkatHttp

' Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
Dim jsonToken As New ChilkatJsonObject
Dim success As Long
success = jsonToken.LoadFile("qa_data/tokens/azureToken.json")
' Assuming success..
http.AuthToken = jsonToken.StringOf("access_token")
Debug.Print "AuthToken: " & http.AuthToken

http.Accept = "application/json"

Dim url As String
url = "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version=2018-11-01"

Dim jsonResp As String
jsonResp = http.QuickGetStr(url)
If (http.LastMethodSuccess <> 1) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Debug.Print "Response Status Code: " & http.LastStatus

Dim json As New ChilkatJsonObject
success = json.Load(jsonResp)
json.EmitCompact = 0
Debug.Print json.Emit()

If (http.LastStatus <> 200) Then
    Debug.Print "Failed."
    Exit Sub
End If

' Sample output...
' (See the parsing code below..)
' 
' Use this online tool to generate parsing code from sample JSON: 
' Generate Parsing Code from JSON

' {
'   "value": [
'     {
'       "sku": {
'         "name": "Standard_LRS",
'         "tier": "Standard"
'       },
'       "kind": "Storage",
'       "id": "/subscriptions/6c42643b-ebef-45e0-b917-b3583b84a57f/resourceGroups/gchilkat/providers/Microsoft.Storage/storageAccounts/chilkat",
'       "name": "chilkat",
'       "type": "Microsoft.Storage/storageAccounts",
'       "location": "eastus",
'       "tags": {},
'       "properties": {
'         "networkAcls": {
'           "bypass": "AzureServices",
'           "virtualNetworkRules": [
'           ],
'           "ipRules": [
'           ],
'           "defaultAction": "Allow"
'         },
'         "supportsHttpsTrafficOnly": true,
'         "encryption": {
'           "services": {
'             "file": {
'               "enabled": true,
'               "lastEnabledTime": "2017-12-28T11:02:10.6840887Z"
'             },
'             "blob": {
'               "enabled": true,
'               "lastEnabledTime": "2017-12-28T11:02:10.6840887Z"
'             }
'           },
'           "keySource": "Microsoft.Storage"
'         },
'         "provisioningState": "Succeeded",
'         "creationTime": "2016-04-18T22:57:36.5377065Z",
'         "primaryEndpoints": {
'           "blob": "https://chilkat.blob.core.windows.net/",
'           "queue": "https://chilkat.queue.core.windows.net/",
'           "table": "https://chilkat.table.core.windows.net/",
'           "file": "https://chilkat.file.core.windows.net/"
'         },
'         "primaryLocation": "eastus",
'         "statusOfPrimary": "available"
'       }
'     }
'   ]
' }
' 

Dim i As Long
Dim count_i As Long
Dim skuName As String
Dim skuTier As String
Dim kind As String
Dim id As String
Dim name As String
Dim v_type As String
Dim location As String
Dim propertiesNetworkAclsBypass As String
Dim propertiesNetworkAclsDefaultAction As String
Dim propertiesSupportsHttpsTrafficOnly As Long
Dim propertiesEncryptionServicesFileEnabled As Long
Dim propertiesEncryptionServicesFileLastEnabledTime As String
Dim propertiesEncryptionServicesBlobEnabled As Long
Dim propertiesEncryptionServicesBlobLastEnabledTime As String
Dim propertiesEncryptionKeySource As String
Dim propertiesProvisioningState As String
Dim propertiesCreationTime As String
Dim propertiesPrimaryEndpointsBlob As String
Dim propertiesPrimaryEndpointsQueue As String
Dim propertiesPrimaryEndpointsTable As String
Dim propertiesPrimaryEndpointsFile As String
Dim propertiesPrimaryLocation As String
Dim propertiesStatusOfPrimary As String

i = 0
count_i = json.SizeOfArray("value")
Do While i < count_i
    json.I = i
    skuName = json.StringOf("value[i].sku.name")
    skuTier = json.StringOf("value[i].sku.tier")
    kind = json.StringOf("value[i].kind")
    id = json.StringOf("value[i].id")
    name = json.StringOf("value[i].name")
    v_type = json.StringOf("value[i].type")
    location = json.StringOf("value[i].location")
    propertiesNetworkAclsBypass = json.StringOf("value[i].properties.networkAcls.bypass")
    propertiesNetworkAclsDefaultAction = json.StringOf("value[i].properties.networkAcls.defaultAction")
    propertiesSupportsHttpsTrafficOnly = json.BoolOf("value[i].properties.supportsHttpsTrafficOnly")
    propertiesEncryptionServicesFileEnabled = json.BoolOf("value[i].properties.encryption.services.file.enabled")
    propertiesEncryptionServicesFileLastEnabledTime = json.StringOf("value[i].properties.encryption.services.file.lastEnabledTime")
    propertiesEncryptionServicesBlobEnabled = json.BoolOf("value[i].properties.encryption.services.blob.enabled")
    propertiesEncryptionServicesBlobLastEnabledTime = json.StringOf("value[i].properties.encryption.services.blob.lastEnabledTime")
    propertiesEncryptionKeySource = json.StringOf("value[i].properties.encryption.keySource")
    propertiesProvisioningState = json.StringOf("value[i].properties.provisioningState")
    propertiesCreationTime = json.StringOf("value[i].properties.creationTime")
    propertiesPrimaryEndpointsBlob = json.StringOf("value[i].properties.primaryEndpoints.blob")
    propertiesPrimaryEndpointsQueue = json.StringOf("value[i].properties.primaryEndpoints.queue")
    propertiesPrimaryEndpointsTable = json.StringOf("value[i].properties.primaryEndpoints.table")
    propertiesPrimaryEndpointsFile = json.StringOf("value[i].properties.primaryEndpoints.file")
    propertiesPrimaryLocation = json.StringOf("value[i].properties.primaryLocation")
    propertiesStatusOfPrimary = json.StringOf("value[i].properties.statusOfPrimary")
    i = i + 1
Loop

 

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