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 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

 

 

 

(DataFlex) Azure List Storage Accounts

Demonstrates how to list Azure storage accounts.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

Use ChilkatAx-win32.pkg

Procedure Test
    Handle hoHttp
Token    Handle hoJsonToken
    Boolean iSuccess
    String sUrl
    String sJsonResp
    Handle hoJson
    Integer i
    Integer iCount_i
    String sSkuName
    String sSkuTier
    String sKind
    String sId
    String sName
    String sV_type
    String sLocation
    String sPropertiesNetworkAclsBypass
    String sPropertiesNetworkAclsDefaultAction
    Boolean iPropertiesSupportsHttpsTrafficOnly
    Boolean iPropertiesEncryptionServicesFileEnabled
    String sPropertiesEncryptionServicesFileLastEnabledTime
    Boolean iPropertiesEncryptionServicesBlobEnabled
    String sPropertiesEncryptionServicesBlobLastEnabledTime
    String sPropertiesEncryptionKeySource
    String sPropertiesProvisioningState
    String sPropertiesCreationTime
    String sPropertiesPrimaryEndpointsBlob
    String sPropertiesPrimaryEndpointsQueue
    String sPropertiesPrimaryEndpointsTable
    String sPropertiesPrimaryEndpointsFile
    String sPropertiesPrimaryLocation
    String sPropertiesStatusOfPrimary
    String sTemp1
    Integer iTemp1
    Boolean bTemp1

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

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

    // Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
    Get Create (RefClass(cComChilkatJsonObject)) To hoJsonToken
    If (Not(IsComObjectCreated(hoJsonToken))) Begin
        Send CreateComObject of hoJsonToken
    End
    Get ComLoadFile Of hoJsonToken "qa_data/tokens/azureToken.json" To iSuccess
    // Assuming success..
    Get ComStringOf Of hoJsonToken "access_token" To sTemp1
    Set ComAuthToken Of hoHttp To sTemp1
    Get ComAuthToken Of hoHttp To sTemp1
    Showln "AuthToken: " sTemp1

    Set ComAccept Of hoHttp To "application/json"

    Move "https://management.azure.com/subscriptions/{subscriptionId}/providers/Microsoft.Storage/storageAccounts?api-version=2018-11-01" To sUrl

    Get ComQuickGetStr Of hoHttp sUrl To sJsonResp
    Get ComLastMethodSuccess Of hoHttp To bTemp1
    If (bTemp1 <> True) Begin
        Get ComLastErrorText Of hoHttp To sTemp1
        Showln sTemp1
        Procedure_Return
    End

    Get ComLastStatus Of hoHttp To iTemp1
    Showln "Response Status Code: " iTemp1

    Get Create (RefClass(cComChilkatJsonObject)) To hoJson
    If (Not(IsComObjectCreated(hoJson))) Begin
        Send CreateComObject of hoJson
    End
    Get ComLoad Of hoJson sJsonResp To iSuccess
    Set ComEmitCompact Of hoJson To False
    Get ComEmit Of hoJson To sTemp1
    Showln sTemp1

    Get ComLastStatus Of hoHttp To iTemp1
    If (iTemp1 <> 200) Begin
        Showln "Failed."
        Procedure_Return
    End

    // 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"
    //       }
    //     }
    //   ]
    // }
    // 

    Move 0 To i
    Get ComSizeOfArray Of hoJson "value" To iCount_i
    While (i < iCount_i)
        Set ComI Of hoJson To i
        Get ComStringOf Of hoJson "value[i].sku.name" To sSkuName
        Get ComStringOf Of hoJson "value[i].sku.tier" To sSkuTier
        Get ComStringOf Of hoJson "value[i].kind" To sKind
        Get ComStringOf Of hoJson "value[i].id" To sId
        Get ComStringOf Of hoJson "value[i].name" To sName
        Get ComStringOf Of hoJson "value[i].type" To sV_type
        Get ComStringOf Of hoJson "value[i].location" To sLocation
        Get ComStringOf Of hoJson "value[i].properties.networkAcls.bypass" To sPropertiesNetworkAclsBypass
        Get ComStringOf Of hoJson "value[i].properties.networkAcls.defaultAction" To sPropertiesNetworkAclsDefaultAction
        Get ComBoolOf Of hoJson "value[i].properties.supportsHttpsTrafficOnly" To iPropertiesSupportsHttpsTrafficOnly
        Get ComBoolOf Of hoJson "value[i].properties.encryption.services.file.enabled" To iPropertiesEncryptionServicesFileEnabled
        Get ComStringOf Of hoJson "value[i].properties.encryption.services.file.lastEnabledTime" To sPropertiesEncryptionServicesFileLastEnabledTime
        Get ComBoolOf Of hoJson "value[i].properties.encryption.services.blob.enabled" To iPropertiesEncryptionServicesBlobEnabled
        Get ComStringOf Of hoJson "value[i].properties.encryption.services.blob.lastEnabledTime" To sPropertiesEncryptionServicesBlobLastEnabledTime
        Get ComStringOf Of hoJson "value[i].properties.encryption.keySource" To sPropertiesEncryptionKeySource
        Get ComStringOf Of hoJson "value[i].properties.provisioningState" To sPropertiesProvisioningState
        Get ComStringOf Of hoJson "value[i].properties.creationTime" To sPropertiesCreationTime
        Get ComStringOf Of hoJson "value[i].properties.primaryEndpoints.blob" To sPropertiesPrimaryEndpointsBlob
        Get ComStringOf Of hoJson "value[i].properties.primaryEndpoints.queue" To sPropertiesPrimaryEndpointsQueue
        Get ComStringOf Of hoJson "value[i].properties.primaryEndpoints.table" To sPropertiesPrimaryEndpointsTable
        Get ComStringOf Of hoJson "value[i].properties.primaryEndpoints.file" To sPropertiesPrimaryEndpointsFile
        Get ComStringOf Of hoJson "value[i].properties.primaryLocation" To sPropertiesPrimaryLocation
        Get ComStringOf Of hoJson "value[i].properties.statusOfPrimary" To sPropertiesStatusOfPrimary
        Move (i + 1) To i
    Loop



End_Procedure

 

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