Alerts.DeleteAlerts method

Deletes the specified alerts within a Web site.

Namespace:  WebSvcAlerts
Assembly:  STSSOAP (in STSSOAP.dll)

[SoapDocumentMethodAttribute("", RequestNamespace = "", 
	ResponseNamespace = "", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public DeleteFailure[] DeleteAlerts(
	string[] IDs


Type: []

A string array that contains the GUIDs of alerts to delete.

Return value

Type: []
A DeleteFailure array that contains the alert ID and error status of unsuccessful deletions.
To access the Alerts service and its methods, set a Web reference to http://Server_Name/[sites/][Site_Name/]_vti_bin/Alerts.asmx.

The following code example deletes all the alerts from the current site.

Web_Reference_Folder_Name.Alerts alertService = new Web_Reference_Folder_Name.Alerts();
alertService.Credentials= System.Net.CredentialCache.DefaultCredentials;

Web_Reference_Folder_Name.AlertInfo alertInfo = alertService.GetAlerts();
Web_Reference_Folder_Name.Alert[] alerts = alertInfo.Alerts;

string[] delString = new string[alerts.Length];

for (int i=0; i<delString.Length; i++)
    delString[i] = alerts[i].Id.ToString();
catch(Exception ex)

The example uses the GetAlerts method to return information about the alerts, assigns the returned information to an array of alerts, and assigns the GUID of each alert in the array to a string array that is passed to the DeleteAlerts method.