Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Excel Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(Excel) Update an Inventory Listing using OAuth1 Authentication

Updates an inventory listing. This example uses OAuth1 authentication instead of providing an api_key=MY_ETSY_KEYSTRING query parameter.

Download Excel Class Modules

Chilkat Excel Class Modules

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

Dim rest As Chilkat.Rest
Set rest = Chilkat.NewRest

Dim oauth1 As Chilkat.OAuth1
Set oauth1 = Chilkat.NewOAuth1

oauth1.ConsumerKey = "CONSUMERKEY"
oauth1.ConsumerSecret = "CONSUMERSECRET"
oauth1.Token = "TOKEN"
oauth1.TokenSecret = "TOKENSECRET"
oauth1.SignatureMethod = "HMAC-SHA1"
success = oauth1.GenNonce(16)


autoReconnect = True

tls = True
success = rest.Connect("openapi.etsy.com",443,tls,autoReconnect)
If (success = False) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If


jsonText = "[{""product_id"":1999949999,""property_values"":[],""offerings"":[{""offering_id"":9999905883,""price"":""36.23"",""quantity"":1}]}]"

success = rest.AddQueryParam("products",jsonText)
success = rest.AddHeader("Content-Type","application/x-www-form-urlencoded")


jsonResponseText = rest.FullRequestFormUrlEncoded("PUT","/v2/listings/228827035/inventory")
If (rest.LastMethodSuccess = False) Then
    Debug.Print rest.LastErrorText
    Exit Sub
End If

Dim jsonResponse As Chilkat.JsonObject
Set jsonResponse = Chilkat.NewJsonObject
success = jsonResponse.Load(jsonResponseText)
jsonResponse.EmitCompact = False

Debug.Print jsonResponse.Emit()

Debug.Print "Response status code: "; rest.ResponseStatusCode

 

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