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) WiX - Get all Products in a Store

Gets the first page of products in a store.

For more information, see https://dev.wix.com/api/rest/wix-stores/catalog/filter-and-sort

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 -X POST -H "Content-Type: application/json" \
'    -d '{
'   "includeVariants": true
'   }' https://www.wixapis.com/stores/v1/products/query

Dim json As New ChilkatJsonObject
success = json.UpdateBool("includeVariants",1)

http.AuthToken = "ACCESS_TOKEN"
http.SetRequestHeader "Content-Type","application/json"

Dim resp As ChilkatHttpResponse
Set resp = http.PostJson3("https://www.wixapis.com/stores/v1/products/query","application/json",json)
If (http.LastMethodSuccess = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

Dim sbResponseBody As New ChilkatStringBuilder
success = resp.GetBodySb(sbResponseBody)
Dim jResp As New ChilkatJsonObject
success = jResp.LoadSb(sbResponseBody)
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)

' {
'   "products": [
'     {
'       "id": "58fcbb51-ff87-08ff-d97b-646726676e4a",
'       "name": "webhook test",
'       "slug": "webhook-test",
'       "visible": true,
'       "productType": "physical",
'       "description": "<p>fasdf<\/p>",
'       "stock": {
'         "trackInventory": true,
'         "quantity": 0,
'         "inStock": false
'       },
'       "price": {
'         "currency": "ILS",
'         "price": 234,
'         "discountedPrice": 234,
'         "formatted": {
'           "price": "234.00 ",
'           "discountedPrice": "234.00 "
'         }
'       },
'       "priceData": {
'         "currency": "ILS",
'         "price": 234,
'         "discountedPrice": 234,
'         "formatted": {
'           "price": "234.00 ",
'           "discountedPrice": "234.00 "
'         }
'       },
'       "additionalInfoSections": [
'       ],
'       "ribbons": [
'         {
'           "text": "ribby"
'         }
'       ],
'       "media": {
'         "items": [
'         ]
'       },
'       "customTextFields": [
'       ],
'       "manageVariants": true,
'       "productOptions": [
'       ],
'       "productPageUrl": {
'         "base": "https://www.my-website.com/",
'         "path": "/product-page/webhook-test"
'       },
'       "numericId": "1567078000586000",
'       "inventoryItemId": "a70344ae-0078-f700-2684-9b98d99891b5",
'       "discount": {
'         "type": "NONE",
'         "value": 0
'       },
'       "collectionIds": [
'       ],
'       "variants": [
'       ]
'     },
'     {
'       "id": "6507fd67-94e5-10af-73e4-d2167852d5bc",
'       "name": "digital product",
'       "slug": "digital-product",
'       "visible": true,
'       "productType": "digital",
'       "description": "",
'       "sku": "",
'       "weight": 0,
'       "stock": {
'         "trackInventory": false,
'         "inStock": true
'       },
'       "price": {
'         "currency": "ILS",
'         "price": 123,
'         "discountedPrice": 123,
'         "formatted": {
'           "price": "123.00 ",
'           "discountedPrice": "123.00 "
'         }
'       },
'       "priceData": {
'         "currency": "ILS",
'         "price": 123,
'         "discountedPrice": 123,
'         "formatted": {
'           "price": "123.00 ",
'           "discountedPrice": "123.00 "
'         }
'       },
'       "additionalInfoSections": [
'       ],
'       "ribbons": [
'       ],
'       "media": {
'         "items": [
'         ]
'       },
'       "customTextFields": [
'       ],
'       "manageVariants": false,
'       "productOptions": [
'       ],
'       "productPageUrl": {
'         "base": "https://www.my-website.com/",
'         "path": "/product-page/digital-product"
'       },
'       "numericId": "1544009414325000",
'       "inventoryItemId": "9af80298-6b1a-ef50-8c1b-2de987ad2a43",
'       "discount": {
'         "type": "NONE",
'         "value": 0
'       },
'       "collectionIds": [
'         "ae886d55-2572-eee8-b2c4-13219844b5e4"
'       ],
'       "variants": [
'       ]
'     }
'   ],
'   "metadata": {
'     "items": 100,
'     "offset": 0
'   },
'   "totalResults": 2
' }

' 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 id As String
Dim name As String
Dim slug As String
Dim visible As Long
Dim productType As String
Dim description As String
Dim stockTrackInventory As Long
Dim stockQuantity As Long
Dim stockInStock As Long
Dim priceCurrency As String
Dim pricePrice As Long
Dim priceDiscountedPrice As Long
Dim priceFormattedPrice As String
Dim priceFormattedDiscountedPrice As String
Dim priceDataCurrency As String
Dim priceDataPrice As Long
Dim priceDataDiscountedPrice As Long
Dim priceDataFormattedPrice As String
Dim priceDataFormattedDiscountedPrice As String
Dim manageVariants As Long
Dim productPageUrlBase As String
Dim productPageUrlPath As String
Dim numericId As String
Dim inventoryItemId As String
Dim discountType As String
Dim discountValue As Long
Dim sku As String
Dim weight As Long
Dim j As Long
Dim count_j As Long
Dim text As String
Dim strVal As String

Dim metadataItems As Long
metadataItems = jResp.IntOf("metadata.items")
Dim metadataOffset As Long
metadataOffset = jResp.IntOf("metadata.offset")
Dim totalResults As Long
totalResults = jResp.IntOf("totalResults")
Dim i As Long
i = 0
Dim count_i As Long
count_i = jResp.SizeOfArray("products")
Do While i < count_i
    jResp.I = i
    id = jResp.StringOf("products[i].id")
    name = jResp.StringOf("products[i].name")
    slug = jResp.StringOf("products[i].slug")
    visible = jResp.BoolOf("products[i].visible")
    productType = jResp.StringOf("products[i].productType")
    description = jResp.StringOf("products[i].description")
    stockTrackInventory = jResp.BoolOf("products[i].stock.trackInventory")
    stockQuantity = jResp.IntOf("products[i].stock.quantity")
    stockInStock = jResp.BoolOf("products[i].stock.inStock")
    priceCurrency = jResp.StringOf("products[i].price.currency")
    pricePrice = jResp.IntOf("products[i].price.price")
    priceDiscountedPrice = jResp.IntOf("products[i].price.discountedPrice")
    priceFormattedPrice = jResp.StringOf("products[i].price.formatted.price")
    priceFormattedDiscountedPrice = jResp.StringOf("products[i].price.formatted.discountedPrice")
    priceDataCurrency = jResp.StringOf("products[i].priceData.currency")
    priceDataPrice = jResp.IntOf("products[i].priceData.price")
    priceDataDiscountedPrice = jResp.IntOf("products[i].priceData.discountedPrice")
    priceDataFormattedPrice = jResp.StringOf("products[i].priceData.formatted.price")
    priceDataFormattedDiscountedPrice = jResp.StringOf("products[i].priceData.formatted.discountedPrice")
    manageVariants = jResp.BoolOf("products[i].manageVariants")
    productPageUrlBase = jResp.StringOf("products[i].productPageUrl.base")
    productPageUrlPath = jResp.StringOf("products[i].productPageUrl.path")
    numericId = jResp.StringOf("products[i].numericId")
    inventoryItemId = jResp.StringOf("products[i].inventoryItemId")
    discountType = jResp.StringOf("products[i].discount.type")
    discountValue = jResp.IntOf("products[i].discount.value")
    sku = jResp.StringOf("products[i].sku")
    weight = jResp.IntOf("products[i].weight")
    j = 0
    count_j = jResp.SizeOfArray("products[i].additionalInfoSections")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].ribbons")
    Do While j < count_j
        jResp.J = j
        text = jResp.StringOf("products[i].ribbons[j].text")
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].media.items")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].customTextFields")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].productOptions")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].collectionIds")
    Do While j < count_j
        jResp.J = j
        strVal = jResp.StringOf("products[i].collectionIds[j]")
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("products[i].variants")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    i = i + 1
Loop

 

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