(Xojo Plugin) Shopify Receive Count of All Products in a Collection
Get a count of all products of a given collection
Dim rest As New Chilkat.Rest
Dim success As Boolean
success = rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_KEY")
success = rest.Connect("chilkat.myshopify.com",443,True,True)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
Dim sbJson As New Chilkat.StringBuilder
success = rest.FullRequestNoBodySb("GET","/admin/products/count.json?collection_id=841564295 ",sbJson)
If (success <> True) Then
System.DebugLog(rest.LastErrorText)
Return
End If
If (rest.ResponseStatusCode <> 200) Then
System.DebugLog("Received error response code: " + Str(rest.ResponseStatusCode))
System.DebugLog("Response body:")
System.DebugLog(sbJson.GetAsString())
Return
End If
Dim json As New Chilkat.JsonObject
success = json.LoadSb(sbJson)
// The following code parses the JSON response.
// A sample JSON response is shown below the sample code.
Dim count As Int32
count = json.IntOf("count")
// A sample JSON response body that is parsed by the above code:
// {
// "count": 1
// }
System.DebugLog("Example Completed.")
|