sqlweb-servicesrestsharepoint-2013event-receiver

How can I access to SharePoint builtin alert me definitions (to user defined alerts) by web service or database query


I don't want to customize alert me in SharePoint like this link

But I want to get alerts properties like:

  1. I want to know that Alerts defined on which list or Doc-Lib?
  2. When they want (email or SMS?) (immediately or everyday they want to SharePoint send alerts)
  3. Who define this alerts (which user)?
  4. How many times this alerts fire in last days? (History)
  5. Is there any way like event handlers in android we subscribe SharePoint event handlers and fire event or run custom code or call web service?

Question : Is there any way to access any of the above items ? (by call web service ? or SQL Query? or any other alternate solution?)

(my Goal : decide to have alternative channels like Telegram Bots or cloud phone (CloudCall can be used with many CRM systems) call and other attractive ways for customers to Notify them. relationship management)

Thanks in advance

Case number 4 or 5 has lower priority : If impossible or hard or spend your time or out of scope of this question we skip that.


Solution

  • Qabbas answer my question here and i add more description here for you.

    1. I want to know that Alerts defined on which list or Doc-Lib?
    2. and When they want (email or SMS?) (immediately or everyday they want to SharePoint send alerts ?

    you can achieve this via SQL query, where The Alerts in SharePoint have been stored in Content Database Specifically at ImmedSubscriptions

    sharepoint-alerts-how-to-repair-them-after-a-web-app-move

    and SchedSubscriptionsTable (more in this link). based on When to Send Alert Option

    enter image description here

    Also, you can use SSOM via C# To get alerts via SPAlertCollection to return the collection of alerts for the Web site or user or list.

    SPSite oSiteCollection = SPContext.Current.Site;
    SPWebCollection collWebsites = oSite.AllWebs;
    foreach (SPWeb oWebsite in collWebsites)
    {
    SPAlertCollection collAlerts = oWebsite.Alerts;
    
        foreach (SPAlert oAlert in collAlerts)
        {
            Label1.Text = SPEncode.HtmlEncode(oWebsite.Title) + " :: " +
                SPEncode.HtmlEncode(oAlert.Title) + " :: " +
                oAlert.User.LoginName + "<BR>";
            writer.Write(strLabelText);
        }
    oWebsite.Dispose();
    }
    

    more about above code here.

    I wrote more details about The two methods and what's each field at ImmedSubscriptions and SchedSubscriptionsTable denote to with detail steps at Get All User Alerts By List Name in SharePoint 2013

    1. Who define this alerts (which user)?

    unfortunately , I can't find any info about the created by for alerts at this tables , only the user ID of the user who will receive alerts.

    1. How many times this alerts fire in last days? (History)

    Some information may be available at EventCache table but I am not sure but I Checked this article that describes in details some stored procedure and other tables related to alerts SharePoint E-Mail Confirmations and Alerts (under the hood)

    Note : to achieve 3,4 you can also build your own custom simple alerts based on your requirement that will do the same functionality of build in alerts via workflow and event receiver (on item not on alerts it's not applicable ) to can track your notification in flexibility manner .

    1. Is there any way like event handlers in android we subscribe SharePoint event handlers and fire event or run custom code or call web service?

    this article may help you External events and alerts in SharePoint 2013