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

 

 

 

(Visual FoxPro) Azure List Storage Accounts

Demonstrates how to list Azure storage accounts.

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

LOCAL loHttp
LOCAL loJsonToken
LOCAL lnSuccess
LOCAL lcUrl
LOCAL lcJsonResp
LOCAL loJson
LOCAL i
LOCAL lnCount_i
LOCAL lcSkuName
LOCAL lcSkuTier
LOCAL lcKind
LOCAL lcId
LOCAL lcName
LOCAL lcV_type
LOCAL lcLocation
LOCAL lcPropertiesNetworkAclsBypass
LOCAL lcPropertiesNetworkAclsDefaultAction
LOCAL lnPropertiesSupportsHttpsTrafficOnly
LOCAL lnPropertiesEncryptionServicesFileEnabled
LOCAL lcPropertiesEncryptionServicesFileLastEnabledTime
LOCAL lnPropertiesEncryptionServicesBlobEnabled
LOCAL lcPropertiesEncryptionServicesBlobLastEnabledTime
LOCAL lcPropertiesEncryptionKeySource
LOCAL lcPropertiesProvisioningState
LOCAL lcPropertiesCreationTime
LOCAL lcPropertiesPrimaryEndpointsBlob
LOCAL lcPropertiesPrimaryEndpointsQueue
LOCAL lcPropertiesPrimaryEndpointsTable
LOCAL lcPropertiesPrimaryEndpointsFile
LOCAL lcPropertiesPrimaryLocation
LOCAL lcPropertiesStatusOfPrimary

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

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http')
loHttp = CreateObject('Chilkat.Http')

* Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJsonToken = CreateObject('Chilkat.JsonObject')
lnSuccess = loJsonToken.LoadFile("qa_data/tokens/azureToken.json")
* Assuming success..
loHttp.AuthToken = loJsonToken.StringOf("access_token")
? "AuthToken: " + loHttp.AuthToken

loHttp.Accept = "application/json"

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

lcJsonResp = loHttp.QuickGetStr(lcUrl)
IF (loHttp.LastMethodSuccess <> 1) THEN
    ? loHttp.LastErrorText
    RELEASE loHttp
    RELEASE loJsonToken
    CANCEL
ENDIF

? "Response Status Code: " + STR(loHttp.LastStatus)

* For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject')
loJson = CreateObject('Chilkat.JsonObject')
loJson.Load(lcJsonResp)
loJson.EmitCompact = 0
? loJson.Emit()

IF (loHttp.LastStatus <> 200) THEN
    ? "Failed."
    RELEASE loHttp
    RELEASE loJsonToken
    RELEASE loJson
    CANCEL
ENDIF

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

i = 0
lnCount_i = loJson.SizeOfArray("value")
DO WHILE i < lnCount_i
    loJson.I = i
    lcSkuName = loJson.StringOf("value[i].sku.name")
    lcSkuTier = loJson.StringOf("value[i].sku.tier")
    lcKind = loJson.StringOf("value[i].kind")
    lcId = loJson.StringOf("value[i].id")
    lcName = loJson.StringOf("value[i].name")
    lcV_type = loJson.StringOf("value[i].type")
    lcLocation = loJson.StringOf("value[i].location")
    lcPropertiesNetworkAclsBypass = loJson.StringOf("value[i].properties.networkAcls.bypass")
    lcPropertiesNetworkAclsDefaultAction = loJson.StringOf("value[i].properties.networkAcls.defaultAction")
    lnPropertiesSupportsHttpsTrafficOnly = loJson.BoolOf("value[i].properties.supportsHttpsTrafficOnly")
    lnPropertiesEncryptionServicesFileEnabled = loJson.BoolOf("value[i].properties.encryption.services.file.enabled")
    lcPropertiesEncryptionServicesFileLastEnabledTime = loJson.StringOf("value[i].properties.encryption.services.file.lastEnabledTime")
    lnPropertiesEncryptionServicesBlobEnabled = loJson.BoolOf("value[i].properties.encryption.services.blob.enabled")
    lcPropertiesEncryptionServicesBlobLastEnabledTime = loJson.StringOf("value[i].properties.encryption.services.blob.lastEnabledTime")
    lcPropertiesEncryptionKeySource = loJson.StringOf("value[i].properties.encryption.keySource")
    lcPropertiesProvisioningState = loJson.StringOf("value[i].properties.provisioningState")
    lcPropertiesCreationTime = loJson.StringOf("value[i].properties.creationTime")
    lcPropertiesPrimaryEndpointsBlob = loJson.StringOf("value[i].properties.primaryEndpoints.blob")
    lcPropertiesPrimaryEndpointsQueue = loJson.StringOf("value[i].properties.primaryEndpoints.queue")
    lcPropertiesPrimaryEndpointsTable = loJson.StringOf("value[i].properties.primaryEndpoints.table")
    lcPropertiesPrimaryEndpointsFile = loJson.StringOf("value[i].properties.primaryEndpoints.file")
    lcPropertiesPrimaryLocation = loJson.StringOf("value[i].properties.primaryLocation")
    lcPropertiesStatusOfPrimary = loJson.StringOf("value[i].properties.statusOfPrimary")
    i = i + 1
ENDDO

RELEASE loHttp
RELEASE loJsonToken
RELEASE loJson


 

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