Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Go Web API Examples

Primary Categories

AWS Translate
Activix CRM
Adyen
Amazon MWS
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Bluzone
CardConnect
ClickBank
Clickatell
Cloudfare
DocuSign
ETrade
Etsy
Facebook
GeoOp
GetHarvest
Jira
MYOB

Magento
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Okta OAuth/OIDC
OneLogin OIDC
PayPal
Peoplevox
Populi
QuickBooks
SOAP finkok.com
Shippo
Shopify
Stripe
SugarCRM
Trello
Twitter
VoiceBase
Vonage
Walmart
Walmart v3
Xero
eBay
effectconnect

 

 

 

(Go) Shopify Receive Count of All Products in a Collection

Get a count of all products of a given collection

Chilkat Go Downloads

Go Package for Windows, Linux, Alpine Linux,
MAC OS X, Solaris, FreeBSD, OpenBSD,
Raspberry Pi and other single board computers

    rest := chilkat.NewRest()
    var success bool

    rest.SetAuthBasic("SHOPIFY_PRIVATE_API_KEY","SHOPIFY_PRIVATE_API_KEY")

    success = rest.Connect("chilkat.myshopify.com",443,true,true)
    if success != true {
        fmt.Println(rest.LastErrorText())
        return
    }

    sbJson := chilkat.NewStringBuilder()
    success = rest.FullRequestNoBodySb("GET","/admin/products/count.json?collection_id=841564295 ",sbJson)
    if success != true {
        fmt.Println(rest.LastErrorText())
        return
    }

    if rest.ResponseStatusCode() != 200 {
        fmt.Println("Received error response code: ", rest.ResponseStatusCode())
        fmt.Println("Response body:")
        fmt.Println(*sbJson.GetAsString())
        return
    }

    json := chilkat.NewJsonObject()
    json.LoadSb(sbJson)

    // The following code parses the JSON response.
    // A sample JSON response is shown below the sample code.
    var count int

    count = json.IntOf("count")

    // A sample JSON response body that is parsed by the above code:

    // {
    //   "count": 1
    // }

    fmt.Println("Example Completed.")

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.