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
(SQL Server) 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/
-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls. -- CREATE PROCEDURE ChilkatSample AS BEGIN DECLARE @hr int -- Important: Do not use nvarchar(max). See the warning about using nvarchar(max). DECLARE @sTmp0 nvarchar(4000) -- This example assumes the Chilkat API to have been previously unlocked. -- See Global Unlock Sample for sample code. DECLARE @http int -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT IF @hr <> 0 BEGIN PRINT 'Failed to create ActiveX component' RETURN END EXEC sp_OASetProperty @http, 'Login', 'api_username' EXEC sp_OASetProperty @http, 'Password', 'api_key' EXEC sp_OASetProperty @http, 'BasicAuth', 1 DECLARE @sbResponseBody int -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT DECLARE @success int EXEC sp_OAMethod @http, 'QuickGetSb', @success OUT, 'https://my-shopware-shop.com/api/articles?limit=2', @sbResponseBody IF @success = 0 BEGIN EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT PRINT @sTmp0 EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @sbResponseBody RETURN END DECLARE @jResp int -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody EXEC sp_OASetProperty @jResp, 'EmitCompact', 0 PRINT 'Response Body:' EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT PRINT @sTmp0 -- 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 DECLARE @id int DECLARE @mainDetailId int DECLARE @supplierId int DECLARE @taxId int DECLARE @priceGroupId int DECLARE @filterGroupId nvarchar(4000) DECLARE @configuratorSetId nvarchar(4000) DECLARE @name nvarchar(4000) DECLARE @description nvarchar(4000) DECLARE @descriptionLong nvarchar(4000) DECLARE @added nvarchar(4000) DECLARE @active int DECLARE @pseudoSales int DECLARE @highlight int DECLARE @keywords nvarchar(4000) DECLARE @metaTitle nvarchar(4000) DECLARE @changed nvarchar(4000) DECLARE @priceGroupActive int DECLARE @lastStock int DECLARE @crossBundleLook int DECLARE @notification int DECLARE @template nvarchar(4000) DECLARE @mode int DECLARE @availableFrom nvarchar(4000) DECLARE @availableTo nvarchar(4000) DECLARE @mainDetailArticleId int DECLARE @mainDetailUnitId int DECLARE @mainDetailNumber nvarchar(4000) DECLARE @mainDetailSupplierNumber nvarchar(4000) DECLARE @mainDetailKind int DECLARE @mainDetailAdditionalText nvarchar(4000) DECLARE @mainDetailActive int DECLARE @mainDetailInStock int DECLARE @mainDetailStockMin nvarchar(4000) DECLARE @mainDetailLastStock int DECLARE @mainDetailWeight nvarchar(4000) DECLARE @mainDetailWidth nvarchar(4000) DECLARE @mainDetailLen nvarchar(4000) DECLARE @mainDetailHeight nvarchar(4000) DECLARE @mainDetailEan nvarchar(4000) DECLARE @mainDetailPurchasePrice nvarchar(4000) DECLARE @mainDetailPosition int DECLARE @mainDetailMinPurchase int DECLARE @mainDetailPurchaseSteps int DECLARE @mainDetailMaxPurchase int DECLARE @mainDetailPurchaseUnit nvarchar(4000) DECLARE @mainDetailReferenceUnit nvarchar(4000) DECLARE @mainDetailPackUnit nvarchar(4000) DECLARE @mainDetailShippingFree int DECLARE @mainDetailReleaseDate nvarchar(4000) DECLARE @mainDetailShippingTime nvarchar(4000) DECLARE @mainDetailAttributeId int DECLARE @mainDetailAttributeArticleDetailId int DECLARE @mainDetailAttributeAttr1 nvarchar(4000) DECLARE @mainDetailAttributeAttr2 nvarchar(4000) DECLARE @mainDetailAttributeAttr3 nvarchar(4000) DECLARE @mainDetailAttributeAttr4 nvarchar(4000) DECLARE @mainDetailAttributeAttr5 nvarchar(4000) DECLARE @mainDetailAttributeAttr6 nvarchar(4000) DECLARE @mainDetailAttributeAttr7 nvarchar(4000) DECLARE @mainDetailAttributeAttr8 nvarchar(4000) DECLARE @mainDetailAttributeAttr9 nvarchar(4000) DECLARE @mainDetailAttributeAttr10 nvarchar(4000) DECLARE @mainDetailAttributeAttr11 nvarchar(4000) DECLARE @mainDetailAttributeAttr12 nvarchar(4000) DECLARE @mainDetailAttributeAttr13 nvarchar(4000) DECLARE @mainDetailAttributeAttr14 nvarchar(4000) DECLARE @mainDetailAttributeAttr15 nvarchar(4000) DECLARE @mainDetailAttributeAttr16 nvarchar(4000) DECLARE @mainDetailAttributeAttr17 nvarchar(4000) DECLARE @mainDetailAttributeAttr18 nvarchar(4000) DECLARE @mainDetailAttributeAttr19 nvarchar(4000) DECLARE @mainDetailAttributeAttr20 nvarchar(4000) DECLARE @mainDetailAttributeApostroph nvarchar(4000) DECLARE @total int EXEC sp_OAMethod @jResp, 'IntOf', @total OUT, 'total' DECLARE @success int EXEC sp_OAMethod @jResp, 'BoolOf', @success OUT, 'success' DECLARE @i int SELECT @i = 0 DECLARE @count_i int EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'data' WHILE @i < @count_i BEGIN EXEC sp_OASetProperty @jResp, 'I', @i EXEC sp_OAMethod @jResp, 'IntOf', @id OUT, 'data[i].id' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailId OUT, 'data[i].mainDetailId' EXEC sp_OAMethod @jResp, 'IntOf', @supplierId OUT, 'data[i].supplierId' EXEC sp_OAMethod @jResp, 'IntOf', @taxId OUT, 'data[i].taxId' EXEC sp_OAMethod @jResp, 'IntOf', @priceGroupId OUT, 'data[i].priceGroupId' EXEC sp_OAMethod @jResp, 'StringOf', @filterGroupId OUT, 'data[i].filterGroupId' EXEC sp_OAMethod @jResp, 'StringOf', @configuratorSetId OUT, 'data[i].configuratorSetId' EXEC sp_OAMethod @jResp, 'StringOf', @name OUT, 'data[i].name' EXEC sp_OAMethod @jResp, 'StringOf', @description OUT, 'data[i].description' EXEC sp_OAMethod @jResp, 'StringOf', @descriptionLong OUT, 'data[i].descriptionLong' EXEC sp_OAMethod @jResp, 'StringOf', @added OUT, 'data[i].added' EXEC sp_OAMethod @jResp, 'BoolOf', @active OUT, 'data[i].active' EXEC sp_OAMethod @jResp, 'IntOf', @pseudoSales OUT, 'data[i].pseudoSales' EXEC sp_OAMethod @jResp, 'BoolOf', @highlight OUT, 'data[i].highlight' EXEC sp_OAMethod @jResp, 'StringOf', @keywords OUT, 'data[i].keywords' EXEC sp_OAMethod @jResp, 'StringOf', @metaTitle OUT, 'data[i].metaTitle' EXEC sp_OAMethod @jResp, 'StringOf', @changed OUT, 'data[i].changed' EXEC sp_OAMethod @jResp, 'BoolOf', @priceGroupActive OUT, 'data[i].priceGroupActive' EXEC sp_OAMethod @jResp, 'BoolOf', @lastStock OUT, 'data[i].lastStock' EXEC sp_OAMethod @jResp, 'IntOf', @crossBundleLook OUT, 'data[i].crossBundleLook' EXEC sp_OAMethod @jResp, 'BoolOf', @notification OUT, 'data[i].notification' EXEC sp_OAMethod @jResp, 'StringOf', @template OUT, 'data[i].template' EXEC sp_OAMethod @jResp, 'IntOf', @mode OUT, 'data[i].mode' EXEC sp_OAMethod @jResp, 'StringOf', @availableFrom OUT, 'data[i].availableFrom' EXEC sp_OAMethod @jResp, 'StringOf', @availableTo OUT, 'data[i].availableTo' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailId OUT, 'data[i].mainDetail.id' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailArticleId OUT, 'data[i].mainDetail.articleId' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailUnitId OUT, 'data[i].mainDetail.unitId' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailNumber OUT, 'data[i].mainDetail.number' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailSupplierNumber OUT, 'data[i].mainDetail.supplierNumber' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailKind OUT, 'data[i].mainDetail.kind' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAdditionalText OUT, 'data[i].mainDetail.additionalText' EXEC sp_OAMethod @jResp, 'BoolOf', @mainDetailActive OUT, 'data[i].mainDetail.active' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailInStock OUT, 'data[i].mainDetail.inStock' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailStockMin OUT, 'data[i].mainDetail.stockMin' EXEC sp_OAMethod @jResp, 'BoolOf', @mainDetailLastStock OUT, 'data[i].mainDetail.lastStock' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailWeight OUT, 'data[i].mainDetail.weight' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailWidth OUT, 'data[i].mainDetail.width' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailLen OUT, 'data[i].mainDetail.len' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailHeight OUT, 'data[i].mainDetail.height' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailEan OUT, 'data[i].mainDetail.ean' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailPurchasePrice OUT, 'data[i].mainDetail.purchasePrice' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailPosition OUT, 'data[i].mainDetail.position' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailMinPurchase OUT, 'data[i].mainDetail.minPurchase' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailPurchaseSteps OUT, 'data[i].mainDetail.purchaseSteps' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailMaxPurchase OUT, 'data[i].mainDetail.maxPurchase' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailPurchaseUnit OUT, 'data[i].mainDetail.purchaseUnit' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailReferenceUnit OUT, 'data[i].mainDetail.referenceUnit' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailPackUnit OUT, 'data[i].mainDetail.packUnit' EXEC sp_OAMethod @jResp, 'BoolOf', @mainDetailShippingFree OUT, 'data[i].mainDetail.shippingFree' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailReleaseDate OUT, 'data[i].mainDetail.releaseDate' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailShippingTime OUT, 'data[i].mainDetail.shippingTime' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailAttributeId OUT, 'data[i].mainDetail.attribute.id' EXEC sp_OAMethod @jResp, 'IntOf', @mainDetailAttributeArticleDetailId OUT, 'data[i].mainDetail.attribute.articleDetailId' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr1 OUT, 'data[i].mainDetail.attribute.attr1' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr2 OUT, 'data[i].mainDetail.attribute.attr2' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr3 OUT, 'data[i].mainDetail.attribute.attr3' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr4 OUT, 'data[i].mainDetail.attribute.attr4' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr5 OUT, 'data[i].mainDetail.attribute.attr5' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr6 OUT, 'data[i].mainDetail.attribute.attr6' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr7 OUT, 'data[i].mainDetail.attribute.attr7' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr8 OUT, 'data[i].mainDetail.attribute.attr8' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr9 OUT, 'data[i].mainDetail.attribute.attr9' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr10 OUT, 'data[i].mainDetail.attribute.attr10' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr11 OUT, 'data[i].mainDetail.attribute.attr11' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr12 OUT, 'data[i].mainDetail.attribute.attr12' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr13 OUT, 'data[i].mainDetail.attribute.attr13' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr14 OUT, 'data[i].mainDetail.attribute.attr14' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr15 OUT, 'data[i].mainDetail.attribute.attr15' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr16 OUT, 'data[i].mainDetail.attribute.attr16' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr17 OUT, 'data[i].mainDetail.attribute.attr17' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr18 OUT, 'data[i].mainDetail.attribute.attr18' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr19 OUT, 'data[i].mainDetail.attribute.attr19' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeAttr20 OUT, 'data[i].mainDetail.attribute.attr20' EXEC sp_OAMethod @jResp, 'StringOf', @mainDetailAttributeApostroph OUT, 'data[i].mainDetail.attribute.apostroph' SELECT @i = @i + 1 END EXEC @hr = sp_OADestroy @http EXEC @hr = sp_OADestroy @sbResponseBody EXEC @hr = sp_OADestroy @jResp END GO |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.