When making a GET request to retrieve configuration information for a product package using the SoftLayer Go SDK, you may encounter an issue where the ItemCategory property is not populated, despite being specified in the object mask.
The default SoftLayer endpoint for REST API calls is different from the one you are using, which appears to be XMLRPC. The presence of the "~/.softlayer" file may be causing the XMLRPC endpoint to be selected.
To resolve this issue, switch the endpoint to the REST enpoint in your code.
// Endpoint for RESTful API calls endpoint := "https://api.softlayer.com/rest/v3" // Create a new session with the REST endpoint sess := session.New(username, apikey, endpoint) // Get SoftLayer_Account service service := services.GetProductPackageService(sess) // Mask to get specific configuration properties mask := "itemCategory" // Call to retrieve configuration, including item category result, err := service.Mask(mask).Id(257).GetConfiguration() if err == nil { // ItemCategory data should now be available in the result object }
The above is the detailed content of Why is my SoftLayer Go SDK GET request failing to retrieve ItemCategory data?. For more information, please follow other related articles on the PHP Chinese website!