November 23, 2017


Delete a notification subscription

The script deletes a notification for a determinate user in a determinate Virtual Guest for more
reference see these reference pages.

Important manual pages:

Author: SoftLayer Technologies, Inc. <>
package main

import (

func main() {
	// SoftLayer API username and key
	username := "set me"
	apikey   := "set me"

	Build a SoftLayer_User_Customer_Notification_Virtual_Guest skeleton object which contains
	the id we wish to delete. To get the notifications for an determinate Virtual Guest call
	the getObject method using the "mask[monitoringUserNotification]"
	notifications := []datatypes.User_Customer_Notification_Virtual_Guest{
		{ Id: sl.Int(10056635) },

	// Create a session
	sess := session.New(username, apikey)

	// Get SoftLayer_User_Customer_Notification_Virtual_Guest service
	customerNotificationService := services.GetUserCustomerNotificationVirtualGuestService(sess)

	// Delete selected subscriptions
	result, err := customerNotificationService.DeleteObjects(notifications)
	if err != nil {
		fmt.Printf("\n Unable to delete subscription\n - %s\n", err)



If this article contains any error, or leaves any of your questions unanswered, please help us out by opening up a github issue.
Open an issue