SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.02k forks source link

SP REST Create Alert API (/_api/Web/CurrentUser/Alerts/Add) #7220

Open salascz opened 3 years ago

salascz commented 3 years ago

What type of issue is this?

Question

What SharePoint development model, framework, SDK or API is this about?

SharePoint REST API

Target SharePoint environment

SharePoint Online

What browser(s) / client(s) have you tested

Additional environment details

No response

Issue description

I am exploring the Alerts REST API (/web/alerts, /web/currentuser/alerts etc.).

I would like to ask, if there is any documentation available for /Alerts/Add endpoint.

It does not seem to be working on my end (other endpoints like list of all alerts, alert details or delete alert works correctly)

POST [site]/_api/Web/CurrentUser/Alerts/Add BODY

{
    "alertCreationInformation": {
        "AlertFrequency": 1,
        "AlertTemplateName": "SPAlertTemplateType.WebPageLibrary",
        "AlertTime": "2021-07-29T11:56:18.9574215+02:00",
        "AlertType": 0,
        "AlwaysNotify": false,
        "DeliveryChannels":1,
        "EventType": -1,
        "EventTypeBitmask"  : 2,
        "Filter": "",
        "Status": 0,
        "Title": "Alert -- generated",
        "Properties": []
    }
}

The AlertCreationInformation type does not contain any property for List, Item or User :( https://s-kainet.github.io/sp-rest-explorer/#/_api/web/CurrentUser/Alerts/Add

Thanks

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

psharplessk2c commented 3 years ago

Any update on this? I too am trying to create an Alert via the API's and I can't figure out to how to do it successfully. The AlertCreationInformation class does not seem to have the fields necessary to tie the new alert to a user or a list.

richpyra commented 3 years ago

I'd love to be able to create an Alert via the SharePoint framework. At the moment it appears to be impossible

alfredogama commented 7 months ago

I'm trying to create a new alert but is not possible. Where is the documentation?