Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(AutoIt) Shopware List ArticlesSee more Shopware ExamplesThis example shows you how to obtain information about a Shopware product list. With the optional limit parameter, it's possible to specify how many products you wish the API call to return. For more information, see https://developers.shopware.com/developers-guide/rest-api/examples/article/
; This example assumes the Chilkat API to have been previously unlocked. ; See Global Unlock Sample for sample code. $oHttp = ObjCreate("Chilkat.Http") $oHttp.Login = "api_username" $oHttp.Password = "api_key" $oHttp.BasicAuth = True $oSbResponseBody = ObjCreate("Chilkat.StringBuilder") Local $bSuccess = $oHttp.QuickGetSb("https://my-shopware-shop.com/api/articles?limit=2",$oSbResponseBody) If ($bSuccess = False) Then ConsoleWrite($oHttp.LastErrorText & @CRLF) Exit EndIf $oJResp = ObjCreate("Chilkat.JsonObject") $oJResp.LoadSb($oSbResponseBody) $oJResp.EmitCompact = False ConsoleWrite("Response Body:" & @CRLF) ConsoleWrite($oJResp.Emit() & @CRLF) ; Sample JSON response: ; (Sample code for parsing the JSON response is shown below) ; { ; "data": [ ; { ; "id": 8283, ; "mainDetailId": 11398, ; "supplierId": 28, ; "taxId": 1, ; "priceGroupId": 1, ; "filterGroupId": null, ; "configuratorSetId": null, ; "name": "TERRA PC-GAMER 8000 iQ9650 VU - \u00e5\u00a0 \u00c7 Produktmer", ; "description": "TERRA PC-GAMER 8000 iQ9650 VU - \u00e5\u00a0 \u00c7 Produktmer", ; "descriptionLong": "...", ; "added": "2000-01-01T00:00:00+0100", ; "active": true, ; "pseudoSales": 0, ; "highlight": false, ; "keywords": null, ; "metaTitle": "TERRA PC-GAMER 8000 iQ9650 VU - \u00e5\u00a0 \u00c7 Produktmer", ; "changed": "2021-02-21T18:20:39+0100", ; "priceGroupActive": false, ; "lastStock": false, ; "crossBundleLook": 0, ; "notification": true, ; "template": "", ; "mode": 0, ; "availableFrom": null, ; "availableTo": null, ; "mainDetail": { ; "id": 11398, ; "articleId": 8283, ; "unitId": 9, ; "number": "WT-1000104", ; "supplierNumber": "", ; "kind": 1, ; "additionalText": "", ; "active": true, ; "inStock": 28, ; "stockMin": null, ; "lastStock": false, ; "weight": "0.000", ; "width": null, ; "len": null, ; "height": null, ; "ean": "4039407005390", ; "purchasePrice": "0", ; "position": 1, ; "minPurchase": 1, ; "purchaseSteps": 0, ; "maxPurchase": 0, ; "purchaseUnit": "0.0000", ; "referenceUnit": "1.000", ; "packUnit": "Stk", ; "shippingFree": false, ; "releaseDate": null, ; "shippingTime": "20", ; "attribute": { ; "id": 11271, ; "articleDetailId": 11398, ; "attr1": null, ; "attr2": null, ; "attr3": null, ; "attr4": null, ; "attr5": null, ; "attr6": null, ; "attr7": null, ; "attr8": null, ; "attr9": null, ; "attr10": null, ; "attr11": "Attributfeld 11 deutsch", ; "attr12": null, ; "attr13": null, ; "attr14": "Wortmann - 80061", ; "attr15": null, ; "attr16": null, ; "attr17": "21.02.2021 18:36:46", ; "attr18": null, ; "attr19": "21.02.2021 18:36:46", ; "attr20": "0,00", ; "apostroph": "" ; } ; } ; }, ; { ; "id": 8284, ; "mainDetailId": 11399, ; "supplierId": 28, ; "taxId": 1, ; "priceGroupId": 1, ; "filterGroupId": null, ; "configuratorSetId": null, ; "name": "TERRA PC-GAMER 9000 iE5420 VU\rProduktmer", ; "description": "TERRA PC-GAMER 9000 iE5420 VU\rProduktmer", ; "descriptionLong": "...", ; "added": "2000-01-01T00:00:00+0100", ; "active": true, ; "pseudoSales": 0, ; "highlight": false, ; "keywords": null, ; "metaTitle": "TERRA PC-GAMER 9000 iE5420 VU\rProduktmer", ; "changed": "2021-02-21T18:20:35+0100", ; "priceGroupActive": false, ; "lastStock": true, ; "crossBundleLook": 0, ; "notification": true, ; "template": "", ; "mode": 0, ; "availableFrom": null, ; "availableTo": null, ; "mainDetail": { ; "id": 11399, ; "articleId": 8284, ; "unitId": 9, ; "number": "WT-1000105", ; "supplierNumber": "", ; "kind": 1, ; "additionalText": "", ; "active": true, ; "inStock": 0, ; "stockMin": null, ; "lastStock": true, ; "weight": "0.000", ; "width": null, ; "len": null, ; "height": null, ; "ean": "4039407006137", ; "purchasePrice": "0", ; "position": 1, ; "minPurchase": 1, ; "purchaseSteps": 0, ; "maxPurchase": 0, ; "purchaseUnit": "0.0000", ; "referenceUnit": "1.000", ; "packUnit": "Stk", ; "shippingFree": false, ; "releaseDate": null, ; "shippingTime": "20", ; "attribute": { ; "id": 11272, ; "articleDetailId": 11399, ; "attr1": null, ; "attr2": null, ; "attr3": null, ; "attr4": null, ; "attr5": null, ; "attr6": null, ; "attr7": null, ; "attr8": null, ; "attr9": null, ; "attr10": null, ; "attr11": "Attributfeld 11 deutsch", ; "attr12": null, ; "attr13": null, ; "attr14": "Wortmann - 80061", ; "attr15": null, ; "attr16": null, ; "attr17": "21.02.2021 18:36:50", ; "attr18": null, ; "attr19": "21.02.2021 18:36:50", ; "attr20": "0,00", ; "apostroph": "" ; } ; } ; } ; ], ; "total": 9, ; "success": true ; } ; Sample code for parsing the JSON response... ; Use the following online tool to generate parsing code from sample JSON: ; Generate Parsing Code from JSON Local $id Local $iMainDetailId Local $iSupplierId Local $iTaxId Local $iPriceGroupId Local $sFilterGroupId Local $sConfiguratorSetId Local $sName Local $sDescription Local $sDescriptionLong Local $sAdded Local $bActive Local $iPseudoSales Local $bHighlight Local $sKeywords Local $sMetaTitle Local $sChanged Local $bPriceGroupActive Local $bLastStock Local $iCrossBundleLook Local $bNotification Local $sTemplate Local $iMode Local $sAvailableFrom Local $sAvailableTo Local $iMainDetailArticleId Local $iMainDetailUnitId Local $sMainDetailNumber Local $sMainDetailSupplierNumber Local $iMainDetailKind Local $sMainDetailAdditionalText Local $bMainDetailActive Local $iMainDetailInStock Local $sMainDetailStockMin Local $bMainDetailLastStock Local $sMainDetailWeight Local $sMainDetailWidth Local $sMainDetailLen Local $sMainDetailHeight Local $sMainDetailEan Local $sMainDetailPurchasePrice Local $iMainDetailPosition Local $iMainDetailMinPurchase Local $iMainDetailPurchaseSteps Local $iMainDetailMaxPurchase Local $sMainDetailPurchaseUnit Local $sMainDetailReferenceUnit Local $sMainDetailPackUnit Local $bMainDetailShippingFree Local $sMainDetailReleaseDate Local $sMainDetailShippingTime Local $iMainDetailAttributeId Local $iMainDetailAttributeArticleDetailId Local $sMainDetailAttributeAttr1 Local $sMainDetailAttributeAttr2 Local $sMainDetailAttributeAttr3 Local $sMainDetailAttributeAttr4 Local $sMainDetailAttributeAttr5 Local $sMainDetailAttributeAttr6 Local $sMainDetailAttributeAttr7 Local $sMainDetailAttributeAttr8 Local $sMainDetailAttributeAttr9 Local $sMainDetailAttributeAttr10 Local $sMainDetailAttributeAttr11 Local $sMainDetailAttributeAttr12 Local $sMainDetailAttributeAttr13 Local $sMainDetailAttributeAttr14 Local $sMainDetailAttributeAttr15 Local $sMainDetailAttributeAttr16 Local $sMainDetailAttributeAttr17 Local $sMainDetailAttributeAttr18 Local $sMainDetailAttributeAttr19 Local $sMainDetailAttributeAttr20 Local $sMainDetailAttributeApostroph Local $iTotal = $oJResp.IntOf("total") Local $bSuccess = $oJResp.BoolOf("success") Local $i = 0 Local $iCount_i = $oJResp.SizeOfArray("data") While $i < $iCount_i $oJResp.I = $i $id = $oJResp.IntOf("data[i].id") $iMainDetailId = $oJResp.IntOf("data[i].mainDetailId") $iSupplierId = $oJResp.IntOf("data[i].supplierId") $iTaxId = $oJResp.IntOf("data[i].taxId") $iPriceGroupId = $oJResp.IntOf("data[i].priceGroupId") $sFilterGroupId = $oJResp.StringOf("data[i].filterGroupId") $sConfiguratorSetId = $oJResp.StringOf("data[i].configuratorSetId") $sName = $oJResp.StringOf("data[i].name") $sDescription = $oJResp.StringOf("data[i].description") $sDescriptionLong = $oJResp.StringOf("data[i].descriptionLong") $sAdded = $oJResp.StringOf("data[i].added") $bActive = $oJResp.BoolOf("data[i].active") $iPseudoSales = $oJResp.IntOf("data[i].pseudoSales") $bHighlight = $oJResp.BoolOf("data[i].highlight") $sKeywords = $oJResp.StringOf("data[i].keywords") $sMetaTitle = $oJResp.StringOf("data[i].metaTitle") $sChanged = $oJResp.StringOf("data[i].changed") $bPriceGroupActive = $oJResp.BoolOf("data[i].priceGroupActive") $bLastStock = $oJResp.BoolOf("data[i].lastStock") $iCrossBundleLook = $oJResp.IntOf("data[i].crossBundleLook") $bNotification = $oJResp.BoolOf("data[i].notification") $sTemplate = $oJResp.StringOf("data[i].template") $iMode = $oJResp.IntOf("data[i].mode") $sAvailableFrom = $oJResp.StringOf("data[i].availableFrom") $sAvailableTo = $oJResp.StringOf("data[i].availableTo") $iMainDetailId = $oJResp.IntOf("data[i].mainDetail.id") $iMainDetailArticleId = $oJResp.IntOf("data[i].mainDetail.articleId") $iMainDetailUnitId = $oJResp.IntOf("data[i].mainDetail.unitId") $sMainDetailNumber = $oJResp.StringOf("data[i].mainDetail.number") $sMainDetailSupplierNumber = $oJResp.StringOf("data[i].mainDetail.supplierNumber") $iMainDetailKind = $oJResp.IntOf("data[i].mainDetail.kind") $sMainDetailAdditionalText = $oJResp.StringOf("data[i].mainDetail.additionalText") $bMainDetailActive = $oJResp.BoolOf("data[i].mainDetail.active") $iMainDetailInStock = $oJResp.IntOf("data[i].mainDetail.inStock") $sMainDetailStockMin = $oJResp.StringOf("data[i].mainDetail.stockMin") $bMainDetailLastStock = $oJResp.BoolOf("data[i].mainDetail.lastStock") $sMainDetailWeight = $oJResp.StringOf("data[i].mainDetail.weight") $sMainDetailWidth = $oJResp.StringOf("data[i].mainDetail.width") $sMainDetailLen = $oJResp.StringOf("data[i].mainDetail.len") $sMainDetailHeight = $oJResp.StringOf("data[i].mainDetail.height") $sMainDetailEan = $oJResp.StringOf("data[i].mainDetail.ean") $sMainDetailPurchasePrice = $oJResp.StringOf("data[i].mainDetail.purchasePrice") $iMainDetailPosition = $oJResp.IntOf("data[i].mainDetail.position") $iMainDetailMinPurchase = $oJResp.IntOf("data[i].mainDetail.minPurchase") $iMainDetailPurchaseSteps = $oJResp.IntOf("data[i].mainDetail.purchaseSteps") $iMainDetailMaxPurchase = $oJResp.IntOf("data[i].mainDetail.maxPurchase") $sMainDetailPurchaseUnit = $oJResp.StringOf("data[i].mainDetail.purchaseUnit") $sMainDetailReferenceUnit = $oJResp.StringOf("data[i].mainDetail.referenceUnit") $sMainDetailPackUnit = $oJResp.StringOf("data[i].mainDetail.packUnit") $bMainDetailShippingFree = $oJResp.BoolOf("data[i].mainDetail.shippingFree") $sMainDetailReleaseDate = $oJResp.StringOf("data[i].mainDetail.releaseDate") $sMainDetailShippingTime = $oJResp.StringOf("data[i].mainDetail.shippingTime") $iMainDetailAttributeId = $oJResp.IntOf("data[i].mainDetail.attribute.id") $iMainDetailAttributeArticleDetailId = $oJResp.IntOf("data[i].mainDetail.attribute.articleDetailId") $sMainDetailAttributeAttr1 = $oJResp.StringOf("data[i].mainDetail.attribute.attr1") $sMainDetailAttributeAttr2 = $oJResp.StringOf("data[i].mainDetail.attribute.attr2") $sMainDetailAttributeAttr3 = $oJResp.StringOf("data[i].mainDetail.attribute.attr3") $sMainDetailAttributeAttr4 = $oJResp.StringOf("data[i].mainDetail.attribute.attr4") $sMainDetailAttributeAttr5 = $oJResp.StringOf("data[i].mainDetail.attribute.attr5") $sMainDetailAttributeAttr6 = $oJResp.StringOf("data[i].mainDetail.attribute.attr6") $sMainDetailAttributeAttr7 = $oJResp.StringOf("data[i].mainDetail.attribute.attr7") $sMainDetailAttributeAttr8 = $oJResp.StringOf("data[i].mainDetail.attribute.attr8") $sMainDetailAttributeAttr9 = $oJResp.StringOf("data[i].mainDetail.attribute.attr9") $sMainDetailAttributeAttr10 = $oJResp.StringOf("data[i].mainDetail.attribute.attr10") $sMainDetailAttributeAttr11 = $oJResp.StringOf("data[i].mainDetail.attribute.attr11") $sMainDetailAttributeAttr12 = $oJResp.StringOf("data[i].mainDetail.attribute.attr12") $sMainDetailAttributeAttr13 = $oJResp.StringOf("data[i].mainDetail.attribute.attr13") $sMainDetailAttributeAttr14 = $oJResp.StringOf("data[i].mainDetail.attribute.attr14") $sMainDetailAttributeAttr15 = $oJResp.StringOf("data[i].mainDetail.attribute.attr15") $sMainDetailAttributeAttr16 = $oJResp.StringOf("data[i].mainDetail.attribute.attr16") $sMainDetailAttributeAttr17 = $oJResp.StringOf("data[i].mainDetail.attribute.attr17") $sMainDetailAttributeAttr18 = $oJResp.StringOf("data[i].mainDetail.attribute.attr18") $sMainDetailAttributeAttr19 = $oJResp.StringOf("data[i].mainDetail.attribute.attr19") $sMainDetailAttributeAttr20 = $oJResp.StringOf("data[i].mainDetail.attribute.attr20") $sMainDetailAttributeApostroph = $oJResp.StringOf("data[i].mainDetail.attribute.apostroph") $i = $i + 1 Wend |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.