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
(Visual FoxPro) 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/
LOCAL loHttp LOCAL loSbResponseBody LOCAL lnSuccess LOCAL loJResp LOCAL lnId LOCAL lnMainDetailId LOCAL lnSupplierId LOCAL lnTaxId LOCAL lnPriceGroupId LOCAL lcFilterGroupId LOCAL lcConfiguratorSetId LOCAL lcName LOCAL lcDescription LOCAL lcDescriptionLong LOCAL lcAdded LOCAL lnActive LOCAL lnPseudoSales LOCAL lnHighlight LOCAL lcKeywords LOCAL lcMetaTitle LOCAL lcChanged LOCAL lnPriceGroupActive LOCAL lnLastStock LOCAL lnCrossBundleLook LOCAL lnNotification LOCAL lcTemplate LOCAL lnMode LOCAL lcAvailableFrom LOCAL lcAvailableTo LOCAL lnMainDetailArticleId LOCAL lnMainDetailUnitId LOCAL lcMainDetailNumber LOCAL lcMainDetailSupplierNumber LOCAL lnMainDetailKind LOCAL lcMainDetailAdditionalText LOCAL lnMainDetailActive LOCAL lnMainDetailInStock LOCAL lcMainDetailStockMin LOCAL lnMainDetailLastStock LOCAL lcMainDetailWeight LOCAL lcMainDetailWidth LOCAL lcMainDetailLen LOCAL lcMainDetailHeight LOCAL lcMainDetailEan LOCAL lcMainDetailPurchasePrice LOCAL lnMainDetailPosition LOCAL lnMainDetailMinPurchase LOCAL lnMainDetailPurchaseSteps LOCAL lnMainDetailMaxPurchase LOCAL lcMainDetailPurchaseUnit LOCAL lcMainDetailReferenceUnit LOCAL lcMainDetailPackUnit LOCAL lnMainDetailShippingFree LOCAL lcMainDetailReleaseDate LOCAL lcMainDetailShippingTime LOCAL lnMainDetailAttributeId LOCAL lnMainDetailAttributeArticleDetailId LOCAL lcMainDetailAttributeAttr1 LOCAL lcMainDetailAttributeAttr2 LOCAL lcMainDetailAttributeAttr3 LOCAL lcMainDetailAttributeAttr4 LOCAL lcMainDetailAttributeAttr5 LOCAL lcMainDetailAttributeAttr6 LOCAL lcMainDetailAttributeAttr7 LOCAL lcMainDetailAttributeAttr8 LOCAL lcMainDetailAttributeAttr9 LOCAL lcMainDetailAttributeAttr10 LOCAL lcMainDetailAttributeAttr11 LOCAL lcMainDetailAttributeAttr12 LOCAL lcMainDetailAttributeAttr13 LOCAL lcMainDetailAttributeAttr14 LOCAL lcMainDetailAttributeAttr15 LOCAL lcMainDetailAttributeAttr16 LOCAL lcMainDetailAttributeAttr17 LOCAL lcMainDetailAttributeAttr18 LOCAL lcMainDetailAttributeAttr19 LOCAL lcMainDetailAttributeAttr20 LOCAL lcMainDetailAttributeApostroph LOCAL lnTotal LOCAL lnSuccess LOCAL i LOCAL lnCount_i * This example assumes the Chilkat API to have been previously unlocked. * See Global Unlock Sample for sample code. * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.Http') loHttp = CreateObject('Chilkat.Http') loHttp.Login = "api_username" loHttp.Password = "api_key" loHttp.BasicAuth = 1 * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.StringBuilder') loSbResponseBody = CreateObject('Chilkat.StringBuilder') lnSuccess = loHttp.QuickGetSb("https://my-shopware-shop.com/api/articles?limit=2",loSbResponseBody) IF (lnSuccess = 0) THEN ? loHttp.LastErrorText RELEASE loHttp RELEASE loSbResponseBody CANCEL ENDIF * For versions of Chilkat < 10.0.0, use CreateObject('Chilkat_9_5_0.JsonObject') loJResp = CreateObject('Chilkat.JsonObject') loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = 0 ? "Response Body:" ? loJResp.Emit() * 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 lnTotal = loJResp.IntOf("total") lnSuccess = loJResp.BoolOf("success") i = 0 lnCount_i = loJResp.SizeOfArray("data") DO WHILE i < lnCount_i loJResp.I = i lnId = loJResp.IntOf("data[i].id") lnMainDetailId = loJResp.IntOf("data[i].mainDetailId") lnSupplierId = loJResp.IntOf("data[i].supplierId") lnTaxId = loJResp.IntOf("data[i].taxId") lnPriceGroupId = loJResp.IntOf("data[i].priceGroupId") lcFilterGroupId = loJResp.StringOf("data[i].filterGroupId") lcConfiguratorSetId = loJResp.StringOf("data[i].configuratorSetId") lcName = loJResp.StringOf("data[i].name") lcDescription = loJResp.StringOf("data[i].description") lcDescriptionLong = loJResp.StringOf("data[i].descriptionLong") lcAdded = loJResp.StringOf("data[i].added") lnActive = loJResp.BoolOf("data[i].active") lnPseudoSales = loJResp.IntOf("data[i].pseudoSales") lnHighlight = loJResp.BoolOf("data[i].highlight") lcKeywords = loJResp.StringOf("data[i].keywords") lcMetaTitle = loJResp.StringOf("data[i].metaTitle") lcChanged = loJResp.StringOf("data[i].changed") lnPriceGroupActive = loJResp.BoolOf("data[i].priceGroupActive") lnLastStock = loJResp.BoolOf("data[i].lastStock") lnCrossBundleLook = loJResp.IntOf("data[i].crossBundleLook") lnNotification = loJResp.BoolOf("data[i].notification") lcTemplate = loJResp.StringOf("data[i].template") lnMode = loJResp.IntOf("data[i].mode") lcAvailableFrom = loJResp.StringOf("data[i].availableFrom") lcAvailableTo = loJResp.StringOf("data[i].availableTo") lnMainDetailId = loJResp.IntOf("data[i].mainDetail.id") lnMainDetailArticleId = loJResp.IntOf("data[i].mainDetail.articleId") lnMainDetailUnitId = loJResp.IntOf("data[i].mainDetail.unitId") lcMainDetailNumber = loJResp.StringOf("data[i].mainDetail.number") lcMainDetailSupplierNumber = loJResp.StringOf("data[i].mainDetail.supplierNumber") lnMainDetailKind = loJResp.IntOf("data[i].mainDetail.kind") lcMainDetailAdditionalText = loJResp.StringOf("data[i].mainDetail.additionalText") lnMainDetailActive = loJResp.BoolOf("data[i].mainDetail.active") lnMainDetailInStock = loJResp.IntOf("data[i].mainDetail.inStock") lcMainDetailStockMin = loJResp.StringOf("data[i].mainDetail.stockMin") lnMainDetailLastStock = loJResp.BoolOf("data[i].mainDetail.lastStock") lcMainDetailWeight = loJResp.StringOf("data[i].mainDetail.weight") lcMainDetailWidth = loJResp.StringOf("data[i].mainDetail.width") lcMainDetailLen = loJResp.StringOf("data[i].mainDetail.len") lcMainDetailHeight = loJResp.StringOf("data[i].mainDetail.height") lcMainDetailEan = loJResp.StringOf("data[i].mainDetail.ean") lcMainDetailPurchasePrice = loJResp.StringOf("data[i].mainDetail.purchasePrice") lnMainDetailPosition = loJResp.IntOf("data[i].mainDetail.position") lnMainDetailMinPurchase = loJResp.IntOf("data[i].mainDetail.minPurchase") lnMainDetailPurchaseSteps = loJResp.IntOf("data[i].mainDetail.purchaseSteps") lnMainDetailMaxPurchase = loJResp.IntOf("data[i].mainDetail.maxPurchase") lcMainDetailPurchaseUnit = loJResp.StringOf("data[i].mainDetail.purchaseUnit") lcMainDetailReferenceUnit = loJResp.StringOf("data[i].mainDetail.referenceUnit") lcMainDetailPackUnit = loJResp.StringOf("data[i].mainDetail.packUnit") lnMainDetailShippingFree = loJResp.BoolOf("data[i].mainDetail.shippingFree") lcMainDetailReleaseDate = loJResp.StringOf("data[i].mainDetail.releaseDate") lcMainDetailShippingTime = loJResp.StringOf("data[i].mainDetail.shippingTime") lnMainDetailAttributeId = loJResp.IntOf("data[i].mainDetail.attribute.id") lnMainDetailAttributeArticleDetailId = loJResp.IntOf("data[i].mainDetail.attribute.articleDetailId") lcMainDetailAttributeAttr1 = loJResp.StringOf("data[i].mainDetail.attribute.attr1") lcMainDetailAttributeAttr2 = loJResp.StringOf("data[i].mainDetail.attribute.attr2") lcMainDetailAttributeAttr3 = loJResp.StringOf("data[i].mainDetail.attribute.attr3") lcMainDetailAttributeAttr4 = loJResp.StringOf("data[i].mainDetail.attribute.attr4") lcMainDetailAttributeAttr5 = loJResp.StringOf("data[i].mainDetail.attribute.attr5") lcMainDetailAttributeAttr6 = loJResp.StringOf("data[i].mainDetail.attribute.attr6") lcMainDetailAttributeAttr7 = loJResp.StringOf("data[i].mainDetail.attribute.attr7") lcMainDetailAttributeAttr8 = loJResp.StringOf("data[i].mainDetail.attribute.attr8") lcMainDetailAttributeAttr9 = loJResp.StringOf("data[i].mainDetail.attribute.attr9") lcMainDetailAttributeAttr10 = loJResp.StringOf("data[i].mainDetail.attribute.attr10") lcMainDetailAttributeAttr11 = loJResp.StringOf("data[i].mainDetail.attribute.attr11") lcMainDetailAttributeAttr12 = loJResp.StringOf("data[i].mainDetail.attribute.attr12") lcMainDetailAttributeAttr13 = loJResp.StringOf("data[i].mainDetail.attribute.attr13") lcMainDetailAttributeAttr14 = loJResp.StringOf("data[i].mainDetail.attribute.attr14") lcMainDetailAttributeAttr15 = loJResp.StringOf("data[i].mainDetail.attribute.attr15") lcMainDetailAttributeAttr16 = loJResp.StringOf("data[i].mainDetail.attribute.attr16") lcMainDetailAttributeAttr17 = loJResp.StringOf("data[i].mainDetail.attribute.attr17") lcMainDetailAttributeAttr18 = loJResp.StringOf("data[i].mainDetail.attribute.attr18") lcMainDetailAttributeAttr19 = loJResp.StringOf("data[i].mainDetail.attribute.attr19") lcMainDetailAttributeAttr20 = loJResp.StringOf("data[i].mainDetail.attribute.attr20") lcMainDetailAttributeApostroph = loJResp.StringOf("data[i].mainDetail.attribute.apostroph") i = i + 1 ENDDO RELEASE loHttp RELEASE loSbResponseBody RELEASE loJResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.