0
votes

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.

2

2 Answers

1
votes

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/

0
votes

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)