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
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 Basic 6.0) Etsy: Get the Inventory for a Listing

Gets the inventory for a listing.

For more information, see https://www.etsy.com/developers/documentation/reference/listinginventory

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 GET \
'   https://openapi.etsy.com/v2/listings/listing_id/inventory?api_key=MY_ETSY_KEYSTRING

Dim sbResponseBody As New ChilkatStringBuilder
success = http.QuickGetSb("https://openapi.etsy.com/v2/listings/listing_id/inventory?api_key=MY_ETSY_KEYSTRING",sbResponseBody)
If (success = 0) Then
    Debug.Print http.LastErrorText
    Exit Sub
End If

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 = http.LastStatus
Debug.Print "Response Status Code = " & respStatusCode
If (respStatusCode >= 400) Then
    Debug.Print "Response Header:"
    Debug.Print http.LastHeader
    Debug.Print "Failed."
    Exit Sub
End If

' Sample JSON response:
' (Sample code for parsing the JSON response is shown below)

' {
'   "count": 1,
'   "results": {
'     "products": [
'       {
'         "product_id": 3361120103,
'         "property_values": [
'         ],
'         "offerings": [
'           {
'             "offering_id": 3579642570,
'             "price": {
'               "amount": 16000,
'               "divisor": 100,
'               "currency_code": "USD",
'               "currency_formatted_short": "$160.00",
'               "currency_formatted_long": "$160.00 USD",
'               "currency_formatted_raw": "160.00"
'             },
'             "quantity": 1
'           }
'         ]
'       }
'     ]
'   },
'   "params": {
'     "listing_id": "720138253",
'     "write_missing_inventory": false
'   },
'   "type": "ListingInventory",
'   "pagination": {}
' }

' 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 product_id As Long
Dim j As Long
Dim count_j As Long
Dim offering_id As Long
Dim priceAmount As Long
Dim priceDivisor As Long
Dim priceCurrency_code As String
Dim priceCurrency_formatted_short As String
Dim priceCurrency_formatted_long As String
Dim priceCurrency_formatted_raw As String
Dim quantity As Long

Dim count As Long
count = jResp.IntOf("count")
Dim paramsListing_id As String
paramsListing_id = jResp.StringOf("params.listing_id")
Dim paramsWrite_missing_inventory As Long
paramsWrite_missing_inventory = jResp.BoolOf("params.write_missing_inventory")
Dim v_type As String
v_type = jResp.StringOf("type")
Dim i As Long
i = 0
Dim count_i As Long
count_i = jResp.SizeOfArray("results.products")
Do While i < count_i
    jResp.I = i
    product_id = jResp.IntOf("results.products[i].product_id")
    j = 0
    count_j = jResp.SizeOfArray("results.products[i].property_values")
    Do While j < count_j
        jResp.J = j
        j = j + 1
    Loop
    j = 0
    count_j = jResp.SizeOfArray("results.products[i].offerings")
    Do While j < count_j
        jResp.J = j
        offering_id = jResp.IntOf("results.products[i].offerings[j].offering_id")
        priceAmount = jResp.IntOf("results.products[i].offerings[j].price.amount")
        priceDivisor = jResp.IntOf("results.products[i].offerings[j].price.divisor")
        priceCurrency_code = jResp.StringOf("results.products[i].offerings[j].price.currency_code")
        priceCurrency_formatted_short = jResp.StringOf("results.products[i].offerings[j].price.currency_formatted_short")
        priceCurrency_formatted_long = jResp.StringOf("results.products[i].offerings[j].price.currency_formatted_long")
        priceCurrency_formatted_raw = jResp.StringOf("results.products[i].offerings[j].price.currency_formatted_raw")
        quantity = jResp.IntOf("results.products[i].offerings[j].quantity")
        j = j + 1
    Loop
    i = i + 1
Loop

 

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