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

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

 

 

 

(Xojo Plugin) Azure Create Storage Account

Demonstrates how to create an Azure storage account.

Chilkat Xojo Plugin Download

Xojo Plugin for Windows, Linux, Mac OS X, and ARM, ARM64

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

Dim http As New Chilkat.Http

// Load an OAuth2 access token previously fetched by this example:  Get Azure OAuth2 Access Token
Dim jsonToken As New Chilkat.JsonObject
Dim success As Boolean
success = jsonToken.LoadFile("qa_data/tokens/azureToken.json")
// Assuming success..
http.AuthToken = jsonToken.StringOf("access_token")
System.DebugLog("AuthToken: " + http.AuthToken)

http.Accept = "application/json"

// Create the following JSON:

// {
//   "sku": {
//     "name": "Standard_GRS"
//   },
//   "kind": "StorageV2",
//   "location": "eastus2",
// }

// Use this online tool to generate the code from sample JSON: 
// Generate Code to Create JSON

Dim jsonRequestBody As New Chilkat.JsonObject
success = jsonRequestBody.UpdateString("sku.name","Standard_GRS")
success = jsonRequestBody.UpdateString("kind","StorageV2")
success = jsonRequestBody.UpdateString("location","eastus2")

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

Dim resp As Chilkat.HttpResponse
resp = http.PText("PUT",url,jsonRequestBody.Emit(),"utf-8","application/json",False,False)
If (http.LastMethodSuccess <> True) Then
    System.DebugLog(http.LastErrorText)
    Return
End If

System.DebugLog("Response Status Code: " + Str(resp.StatusCode))

Dim json As New Chilkat.JsonObject
success = json.Load(resp.BodyStr)
json.EmitCompact = False
System.DebugLog(json.Emit())

If (resp.StatusCode >= 300) Then
    System.DebugLog("Failed.")

    Return
End If

// Successful requests to create a new account return a 202 status code with an empty response body. The storage account is created asynchronously. 
// If the account already exists or is being provisioned, the request response has a 200 return code with the configuration of the existing storage account in the response body.
If (resp.StatusCode = 202) Then
    System.DebugLog("Azure-AsyncOperation: " + resp.GetHeaderField("Azure-AsyncOperation"))
End If

If (resp.StatusCode = 200) Then

    // Parse a response like this:

    // 	{
    // 	  "sku": {
    // 	    "name": "Standard_GRS",
    // 	    "tier": "Standard"
    // 	  },
    // 	  "kind": "StorageV2",
    // 	  "id": "/subscriptions/6c42643b-ebef-45f0-b917-b3583b84a57f/resourceGroups/gChilkat/providers/Microsoft.Storage/storageAccounts/chilkatsoftware",
    // 	  "name": "chilkatsoftware",
    // 	  "type": "Microsoft.Storage/storageAccounts",
    // 	  "location": "eastus2",
    // 	  "tags": {},
    // 	  "properties": {
    // 	    "networkAcls": {
    // 	      "bypass": "AzureServices",
    // 	      "virtualNetworkRules": [
    // 	      ],
    // 	      "ipRules": [
    // 	      ],
    // 	      "defaultAction": "Allow"
    // 	    },
    // 	    "supportsHttpsTrafficOnly": false,
    // 	    "encryption": {
    // 	      "services": {
    // 	        "file": {
    // 	          "enabled": true,
    // 	          "lastEnabledTime": "2019-05-14T22:18:33.2246670Z"
    // 	        },
    // 	        "blob": {
    // 	          "enabled": true,
    // 	          "lastEnabledTime": "2019-05-14T22:18:33.2246670Z"
    // 	        }
    // 	      },
    // 	      "keySource": "Microsoft.Storage"
    // 	    },
    // 	    "accessTier": "Hot",
    // 	    "provisioningState": "Succeeded",
    // 
    // 	    "creationTime": "2019-05-14T22:18:33.1309165Z",
    // 	    "primaryEndpoints": {
    // 	      "dfs": "https://chilkatsoftware.dfs.core.windows.net/",
    // 	      "web": "https://chilkatsoftware.z20.web.core.windows.net/",
    // 	      "blob": "https://chilkatsoftware.blob.core.windows.net/",
    // 	      "queue": "https://chilkatsoftware.queue.core.windows.net/",
    // 	      "table": "https://chilkatsoftware.table.core.windows.net/",
    // 	      "file": "https://chilkatsoftware.file.core.windows.net/"
    // 	    },
    // 	    "primaryLocation": "eastus2",
    // 	    "statusOfPrimary": "available",
    // 	    "secondaryLocation": "centralus",
    // 	    "statusOfSecondary": "available"
    // 	  }
    // 	}

    // Use this online tool to generate parsing code from sample JSON: 
    // Generate Parsing Code from JSON

    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 Boolean
    Dim propertiesEncryptionServicesFileEnabled As Boolean
    Dim propertiesEncryptionServicesFileLastEnabledTime As String
    Dim propertiesEncryptionServicesBlobEnabled As Boolean
    Dim propertiesEncryptionServicesBlobLastEnabledTime As String
    Dim propertiesEncryptionKeySource As String
    Dim propertiesAccessTier As String
    Dim propertiesProvisioningState As String
    Dim propertiesCreationTime As String
    Dim propertiesPrimaryEndpointsDfs As String
    Dim propertiesPrimaryEndpointsWeb 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
    Dim propertiesSecondaryLocation As String
    Dim propertiesStatusOfSecondary As String
    Dim i As Int32
    Dim count_i As Int32

    skuName = json.StringOf("sku.name")
    skuTier = json.StringOf("sku.tier")
    kind = json.StringOf("kind")
    id = json.StringOf("id")
    name = json.StringOf("name")
    v_type = json.StringOf("type")
    location = json.StringOf("location")
    propertiesNetworkAclsBypass = json.StringOf("properties.networkAcls.bypass")
    propertiesNetworkAclsDefaultAction = json.StringOf("properties.networkAcls.defaultAction")
    propertiesSupportsHttpsTrafficOnly = json.BoolOf("properties.supportsHttpsTrafficOnly")
    propertiesEncryptionServicesFileEnabled = json.BoolOf("properties.encryption.services.file.enabled")
    propertiesEncryptionServicesFileLastEnabledTime = json.StringOf("properties.encryption.services.file.lastEnabledTime")
    propertiesEncryptionServicesBlobEnabled = json.BoolOf("properties.encryption.services.blob.enabled")
    propertiesEncryptionServicesBlobLastEnabledTime = json.StringOf("properties.encryption.services.blob.lastEnabledTime")
    propertiesEncryptionKeySource = json.StringOf("properties.encryption.keySource")
    propertiesAccessTier = json.StringOf("properties.accessTier")
    propertiesProvisioningState = json.StringOf("properties.provisioningState")
    propertiesCreationTime = json.StringOf("properties.creationTime")
    propertiesPrimaryEndpointsDfs = json.StringOf("properties.primaryEndpoints.dfs")
    propertiesPrimaryEndpointsWeb = json.StringOf("properties.primaryEndpoints.web")
    propertiesPrimaryEndpointsBlob = json.StringOf("properties.primaryEndpoints.blob")
    propertiesPrimaryEndpointsQueue = json.StringOf("properties.primaryEndpoints.queue")
    propertiesPrimaryEndpointsTable = json.StringOf("properties.primaryEndpoints.table")
    propertiesPrimaryEndpointsFile = json.StringOf("properties.primaryEndpoints.file")
    propertiesPrimaryLocation = json.StringOf("properties.primaryLocation")
    propertiesStatusOfPrimary = json.StringOf("properties.statusOfPrimary")
    propertiesSecondaryLocation = json.StringOf("properties.secondaryLocation")
    propertiesStatusOfSecondary = json.StringOf("properties.statusOfSecondary")
End If

System.DebugLog("Success.")


 

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