This topic has not yet been rated - Rate this topic

Alerts.GetAlerts Method

Windows SharePoint Services 3
Returns information about the alerts within a Web site.

Web Service: AlertsWeb Reference: http://<Site>/_vti_bin/Alerts.asmx
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/GetAlerts", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/2002/1/alerts/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public AlertInfo GetAlerts ()

Return Value

An AlertInfo structure whose fields contain information about each alert, as well as the URL of the page for managing alerts on the site, the name of the server, the type of site definition used to create the site (for example, STS), the URL of the site, the GUID identifying the site, the title of the site, the display name of the current user, and the URL of the page used for choosing a list or document library when creating an alert through the My Alerts on this Site page.

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 displays information about the alerts for 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 allAlerts = alertService.GetAlerts();

MessageBox.Show("Server: " + allAlerts.AlertServerName +
    "\nURL: " + allAlerts.AlertServerUrl +
    "\nWeb Title: " + allAlerts.AlertWebTitle +
    "\nNumber: " + allAlerts.Alerts.Length.ToString());
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ