Chilkat Examples

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

Visual Basic 6.0 Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Bitfinex v2 REST
Bluzone
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
Jira
Lightspeed
MYOB
Magento
Mailgun

MedTunnel
MercadoLibre
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Okta OAuth/OIDC
OneLogin OIDC
OneNote
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
UniPin
VoiceBase
Vonage
Walmart
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yousign
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Visual Basic 6.0) Shopware Create a New Product

See more Shopware Examples

Create a new product in Shopware.

For more information, see https://developers.shopware.com/developers-guide/rest-api/examples/article/#step-1-create-a-new-product

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

http.Login = "api_username"
http.Password = "api_key"
http.BasicAuth = 1

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

' The following JSON is sent in the request body.

' {
'   "name": "Sport Shoes",
'   "active": true,
'   "tax": 19,
'   "supplier": "Sport Shoes Inc.",
'   "categories": [
'     {
'       "id": 384
'     }
'   ],
'   "mainDetail": {
'     "number": "turn",
'     "active": true,
'     "prices": [
'       {
'         "customerGroupKey": "EK",
'         "price": 999
'       }
'     ]
'   }
' }

Dim json As New ChilkatJsonObject
success = json.UpdateString("name","Sport Shoes")
success = json.UpdateBool("active",1)
success = json.UpdateInt("tax",19)
success = json.UpdateString("supplier","Sport Shoes Inc.")
success = json.UpdateInt("categories[0].id",384)
success = json.UpdateString("mainDetail.number","turn")
success = json.UpdateBool("mainDetail.active",1)
success = json.UpdateString("mainDetail.prices[0].customerGroupKey","EK")
success = json.UpdateInt("mainDetail.prices[0].price",999)

Dim resp As ChilkatHttpResponse
Set resp = http.PostJson3("https://my-shopware-shop.com/api/articles","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()

' A 201 response code indicates success.
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)

' {
'   "success": true,
'   "data": {
'     "id": 8312,
'     "location": "https:\/\/my-shopware-shop.com\/api\/articles\/8312"
'   }
' }

' 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 success As Long
success = jResp.BoolOf("success")
Dim dataId As Long
dataId = jResp.IntOf("data.id")
Dim dataLocation As String
dataLocation = jResp.StringOf("data.location")

 

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