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
(PowerBuilder) Shopify Receive Count of All Products in a CollectionGet a count of all products of a given collection
integer li_rc oleobject loo_Rest integer li_Success oleobject loo_SbJson oleobject loo_Json integer li_Count loo_Rest = create oleobject // Use "Chilkat_9_5_0.Rest" for versions of Chilkat < 10.0.0 li_rc = loo_Rest.ConnectToNewObject("Chilkat.Rest") if li_rc < 0 then destroy loo_Rest MessageBox("Error","Connecting to COM object failed") return end if loo_Rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_KEY") li_Success = loo_Rest.Connect("chilkat.myshopify.com",443,1,1) if li_Success <> 1 then Write-Debug loo_Rest.LastErrorText destroy loo_Rest return end if loo_SbJson = create oleobject // Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0 li_rc = loo_SbJson.ConnectToNewObject("Chilkat.StringBuilder") li_Success = loo_Rest.FullRequestNoBodySb("GET","/admin/products/count.json?collection_id=841564295 ",loo_SbJson) if li_Success <> 1 then Write-Debug loo_Rest.LastErrorText destroy loo_Rest destroy loo_SbJson return end if if loo_Rest.ResponseStatusCode <> 200 then Write-Debug "Received error response code: " + string(loo_Rest.ResponseStatusCode) Write-Debug "Response body:" Write-Debug loo_SbJson.GetAsString() destroy loo_Rest destroy loo_SbJson return end if loo_Json = create oleobject // Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0 li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject") loo_Json.LoadSb(loo_SbJson) // The following code parses the JSON response. // A sample JSON response is shown below the sample code. li_Count = loo_Json.IntOf("count") // A sample JSON response body that is parsed by the above code: // { // "count": 1 // } Write-Debug "Example Completed." destroy loo_Rest destroy loo_SbJson destroy loo_Json |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.