0

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 Answers 2

1
+50

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/

4
  • 1
    Thank you for you answer. It's really no wonder Sharepoint was the most dreaded platform to work with in 2018 Stackoverflow Survey. I will award this answer the bounty if there are no other answers. Any chance you would know if it's possible to access Shared Sharepoint Calendars via REST api? I don't see shared calendars listed in the lists api.
    – Suba S
    Commented Dec 12, 2018 at 17:49
  • Do you mean group calendars in O365?
    – Szab
    Commented Dec 12, 2018 at 18:42
  • No, someone from a different organization (xxxxxx.sharepoint.com) shared (gave read/write access to) a calendar that is in their organization. I belong to a different organization (let's say, yyyyy.sharepoint.com). I am trying to read events in that calendar using sharepoint api with my credentials. No success yet.
    – Suba S
    Commented Dec 13, 2018 at 17:16
  • You might verify whether you have the Use Remote Interfaces permission level set for your account. Also, you might have to obtain the X-Request-Digest token from that tenant and then add it to your requests explicitly.
    – Szab
    Commented Dec 13, 2018 at 17:35
0

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)

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.