Webhooks Sharepoint: Subscribing to Document Change - sharepoint

Are there Webhooks available for Sharepoint APIs which can be used to notify when there are changes in a document stored in Sharepoint.

Yes, if you are using SharePoint online, they are available for events corresponding to list item changes for a given SharePoint list or a document library.
They support the below async events:
ItemAdded
ItemUpdated
ItemDeleted
ItemCheckedOut
ItemCheckedIn
ItemUncheckedOut
ItemAttachmentAdded
ItemAttachmentDeleted
ItemFileMoved
ItemVersionDeleted
ItemFileConverted
References - Getting started with webhooks
Webhooks reference implementation

Related

Get recurrence data of sharepoint calendar events using microsoft graph api?

Is there a way to get recurrence information of sharepoint calendar events using the graph api? I can get the event fields using this endpoint but I could not figure out a way to get event recurrence data of sharepoint calendar event using graph api.
If there's no way to do that, is there any documentation regarding working with sharepoint calendars? I could not really find any official documentation for it.
Not sure about Graph, but here's what I know. There has always been a problem when it comes to expanding the recurrence data in calendar events - AFAIK there is no way to retrieve this piece of info using JSOM nor REST for item collections. It is possible though to get this information for a single item in a form of an XML. All you have to do is to fetch and read the RecurrenceData property of an item. Example endpoint URL:
https://[tenantUrl]/_api/web/lists/getByTitle('Events')/items(1)?$select=Title,RecurrenceData
It will return something like the following in the RecurrenceData field:
<recurrence>
<rule>
<firstDayOfWeek>su</firstDayOfWeek>
<repeat><daily dayFrequency="1" /></repeat>
<repeatInstances>10</repeatInstances>
</rule>
</recurrence>
You can try to fetch that property using the provided Graph endpoint but I don't know what the result will be and unfortunately I don't have a way to check it right now - sorry!
Also, have a look at this thread on the SharePoint StackExchange: https://sharepoint.stackexchange.com/questions/23221/rest-api-expand-recurring-calendar-events?noredirect=1&lq=1
I've also recently stumbled upon a neat little library on Reddit, which simplifies common calendar tasks and allows to get this info using SOAP service. You can find it here: https://spcalendarpro.sharepointhacks.com/
This is what worked for me to get RecurrenceData for a SharePoint calendar list in Azure using Graph API:
/v1.0/sites/root/lists/<list_guid>/items?$expand=fields($select=Title,RecurrenceData)

How to get data between connecting web part in Sharepoint 2013

are there any ways that in the eventreceiver of one of the two connected lists, i can get the filter value between 2 connected list web parts.
BR
Kelvin
Event receiver will not help you as it triggers item related events like create, update, delete. Event receiver cannot reach data sent from one webpart to another. You can create your own webpart that can receive data and connect it to task webpart same way as webpart with document library. I created webpart that can get data from another webpart via data connection. You can find it here including sources: https://spgooglemappart.codeplex.com

Can i get the event about file operation on OneDrive?

As we know, we can add remote event receiver to the list. then if there is a item added or updated in this list, we can get the event send by sharepoint 2013 online.
This is the info about event in sharepoint:
[https://msdn.microsoft.com/en-us/library/Microsoft.SharePoint.SPItemEventReceiver_methods.aspx]
So can we have this kind of method in OneDrive(skydrive) too?
It means when there is a file added in the OneDrive, then my App can get this event and take some action on this file.
thanks.
The OneDrive API does not (yet!) support subscriptions to events. Please visit the OneDrive user voice and make/vote up topics that you'd like to see implemented.
To question #2 the view.changes api allows for applications to easily know which changes have happened since the application last queried OneDrive might be just what you need without subscriptions.

SharePoint API - callback for any document upload

Does SharePoint have a hook / API for getting notified whenever a document is added / modified /deleted? I'd like to parse the document and send some of the information to another system. Preferably, this would be on the server side of SharePoint.
You can use SharePoint event receivers.

workflow or EventListener

We are building an extranet sharepoint portal for our clients. Each client will have a site. Total number of sites will be between 2000-3000.
I have a requirement to copy a document from a SiteCollectionA/SiteA/DocumentLibrary to another global list on another site collection when a client uploads new document.
Should i create workflow to copy the document or event listener? Client will be allowed to update document properties after the upload and these changes will have to be pushed into the global list as well.
My choice would be event listener because is much cleaner, cheaper and easier. Im not an expert with workflows, but i think it will be harder to maintain/update/re-publish workflows on 2000+ sites then an event listener.
What do you guys think?
Thanks
Definitely an event receiver, all you are doing is a simple mechanical action in response to an event.
Event receivers are much easier to develop, deploy and maintain.

Resources