Create SharePoint list/item alerts using SharePoint Rest service endpoints - sharepoint

I am working on an application where I need to enable user to follow/subscribe to the documents. So, the user will get notified whenever there is a change in the file or folder that user is subscribed to. I am considering to consume SharePoint Rest API endpoint '_api/web/alerts' (Ref) to create document/folder level alerts within SharePoint 2016 environment. The abovementioned endpoint seem to work in SharePoint 2019/ Online (to at least get the alerts that user is subscribed to) but when I try to consume this endpoint for SharePoint 2016, It throws a 404 error:
Is this endpoint available in Rest API's for SharePoint 2016 or am I missing something? Or is there any other endpoint to create alerts in SP 2016 environments?

Related

MS Graph can't query for SharePoint data

I'm trying to query 365 SharePoint list data from MS Graph.
I've setup the app via portal.azure.com and I gave it application permissions to everything that is required for User, Mail, Sites and Groups. I gave it permissions on the MS Graph and SharePoint sections within the permissions.
I can query for Users and their calendar information but when it comes to Sites I get the following.
Image of Api response
We have the Azure AD Premium P1 subscription for Education.
I tried using the same tenant ID, Client ID and secret in Postman and I get similar results.
I tried to query for the same data via myself logged into Graph Explorer and I get the data I'm expecting.
How can I query for the data from SharePoint via the app credentials for all sites and all data in my tenant
Thank you.
Users may be unable to access multiple Microsoft 365 services, any service that leverages Azure Active Directory (AAD) may be affected. Microsoft is working on this issue actively.
Microsoft 365 Service health status

What permissions are required to call /_api/hubsites and get results?

We are trying to use the SharePoint REST API to retrieve the list of hubs a user has access to. When I, as a SharePoint admin call the api (https://[tenant].sharepoint.com/_api/hubsites) I get the list of hubs correctly. However when anyone else calls the api they get a empty response. They have contribute rights to the SharePoint home site as well as the Hub and all connected sites.
Thanks
Based on Microsoft Documentation , this RESTful service should be "callable" by any user with read permission to the site.
Gets information about all hub sites that the current user can access.
Are you sure those users do have access to Hub sites? Can you share the empty responses you gerfrom those users calls?

subscribe to notifications for changes in any of the tenant SharePoint sites using Microsoft Graph?

Is it possible to use Microsoft Graph in order to create subscriptions (and therefore - notifications) for changes in documents libraries across all SharePoint sites of certain tenant?
I need to be notified when a change is made to a SharePoint site of a tenant (e.g. a file was uploaded to the site document library).
Up until now, I was able to create subscription for changes in the default TeamSite by creating subscription with resource: drive/root.
But that's not enough, if I create another TeamSite then I can't find a way to receive notifications for its changes as well.
The same is true for communication sites - I can't find a way to get notifications for changes in them.
Currently, my AAD App is asking only for Sites.Manage.All permission, but if asking for more permissions can help then it's not a problem.
Is doing what I want possible? Or notifications are only supported for the default SharePoint TeamSite?
If receiving changes in push by subscribing to notifications isn't possible, then I guess I'll have to poll for changes by using delta links.. that should work for any SharePoint site, right?
This is not supported by the graph today. If you'd like to advocate for such a feature, please post it on uservoice. The alternative would be to subscribe to each drive individually.

Secure CRUD SharePoint rest apis

Is it possible to secure SharePoint rest APIs?
I have a SharePoint portal that allows users to create accounts an get access to the portal.
The portal uses SharePoint client object model, if any of the users try to access let's say getuserbyid method or retrieving items for lists and changes the ID value, he will be able to retrieve information for other users on the portal.
So it is possible or is their any way to restrict access to the rest APIs outside the portal itself? Because with manipulation using Fiddler or burp suite the request can be replayed with different information or values.
The operations performed by the Client Side Object Model respect the SharePoint site permissions in the SharePoint site you are interacting with. You need to set/customize the site permissions such that you get the results that you want.

Office 365 and Sharepoint apps

is there a way to create a access web app and use as database an azure sql database. and use it as the main application database or a secondary one.
Either is it possible to create a database that is shared over more than one sharepoint app.
Last but not least is there a way to catch the visitors microsoft mail and use it in a macro to change the views depending on the accesslevel we want him to have on our app.So we can create for example user based profile, either with that way or with creating a user login and registration form.
Thanks in advance.
is there a way to create a access web app and use as database an azure sql database
When you design and modify in Access 2013 or later, the data and database objects are stored in SQL Server or Microsoft Azure SQL Database, so you can share the data within your organization using on-premises SharePoint 2013 or Office 365 for business.
Last but not least is there a way to catch the visitors microsoft mail
You could use the Access Custom Web App Function to get the email address , it could be used in user interface (UI) macros .
UserEmailAddress Function (Access custom web app)

Resources