Microsoft Graph API getSchedule all-day events - microsoft-graph-api

I am attempting to create a vacation leave calendar for my team using the Microsoft Graph API. I have successfully used the /me/calendar/getSchedule endpoint as described in https://learn.microsoft.com/en-us/graph/outlook-get-free-busy-schedule.
However, the response does not include all-day events. Most people book leave for multiple days at a time. I would expect to see "oof" events (status 3) for whole 24 hour periods, but instead there are none.
Is there an option I am missing or another API that can provide this?

Related

Microsoft Graph API: License assignment time without utilizing audit logs

I want to get the license assignment time for each license assigned to each user in a tenant. Using the audit logs I'm able to fetch this data but its partial in nature as the audit logs are retained for 30 days by default, so I can't get the time of license assignment if it happened before this 30 day period.
Is there any other workaround for this using the Graph API only, where I can get the information about license assignment time for each user and their assigned licenses irrelevant of the assignment period
https://graph.microsoft.com/beta/users?$select=id,displayName,assignedLicenses,assignedPlans
In this above query, you get the data of assigned licenses, assigned plans of the user, and their assignedDateTime, but currently, you cann't filter assignedplans by graph api needs to handle through code (in general, only those properties where the documentation says "supports $filter" can be filtered). So you can raise the UserVoice if you want to $filter to support assigned plan

Microsoft Team creation using REST API taking more time

I am using Standard Template to create a MSTeams Team that includes installing an app using 'https://graph.microsoft.com/beta/teams' REST API.
As it returns teamsasyncoperation (https://learn.microsoft.com/en-us/graph/api/resources/teamsasyncoperation?view=graph-rest-beta) I periodically hit the teamsasyncoperation that is in the location header to get the status.
The document mentions periodically check with more than 30 seconds interval.
It is too much time to wait. And now-a-days often I receive the response as 'notStarted' even after 20 minutes.
Why is MSTeams taking that long to create the team? Is there any best way to create the team (that includes install app,create a channel and add members) quickly within 10 seconds?
Does Microsoft provides any paid subscription to make the Team creation as higher priority and quicker?

Microsoft Graph API question: how do I get event instance data via iCalUId

Here's my problem: I am using Microsoft Graph API v1.0 and would like to get the details of an instance of a recurring calendar event. All I got is the iCalUId of the instance.
I tried this call:
https://graph.microsoft.com/v1.0/me/events?$filter=iCalUId eq 'the value of the iCalUId'
This was also suggested in Microsoft graph API: finding event by iCalUid.
This works fine for single events.
But it does not work for instances of recurring meetings: then the call returns an empty value. I just verified this in the Graph Explorer https://developer.microsoft.com/en-us/graph/graph-explorer
Am I doing something wrong (even though the iCalUId is unique to the instance)? Is there a different call I could use?
This is happening because instances of recurring meetings don't actually exist on the server. When you use the /me/events endpoint, you are getting only single-instance and series masters events - it does not trigger the server to expand recurring events into individual instances.
To get server-side expansion, you have to use the /me/calendarview endpoint. This does require that you specify a date range though. For example, this works:
GET /me/calendarview?startDateTime=2020-01-31T00:00:00
&endDateTime=2020-02-29T00:00:00&
$filter=iCalUId eq '040000008200E00074C5B7101A82E00807E40204756DC3EEFFE5CC01000000000000000010000000FCE197631C1A2E4C89172A4115BEB7B5'

How to start using Delta function in Microsoft graph by skipping initial data

Microsoft recommends to use delta function in combination with Subscriptions/Notifications to synchronize mailbox. So my plan is:
Create subscription
Receive notification about new mail in inbox
Use delta function to get latest changes in the inbox
My mailbox already has several thousands of letters. If I run the query
https://graph.microsoft.com/v1.0/users/{id}/mailFolders/inbox/messages/delta
It will return in response #odata.nextLink with $skiptoken param many times and only after I get all the thousands of emails in my mailbox I will receive response with $deltatoken to track new changes.
Is there a way to get deltatoken after the first request? I don't want to synchronize the old messages. I want to skip all old messages in inbox and have a fresh start.
Today the delta query functionality does not support this scenario. To request new features please post ideas to uservoice
This is supported for some endpoints. You can use $deltaToken=latest to get just a deltaToken without any resource data. It's not, as far as I can tell, available for mailboxes… but who knows, maybe it will be soon.
This is not documented anywhere in the documentation for the specific APIs that do support it, but is instead documented in the Overview for change tracking. Why? Because Microsoft wants you to be sad all the time.

How can I poll the OneNote API frequently without hitting rate limits?

I have a use case where I need to poll the OneNote API approximately every minute in order to respond to text added to pages by the user.
(Aside: I'd LOVE to use webhooks to get notifications only when something changes, but that's only supported for consumer notebooks at this time, as far as I can tell.)
Polling with this frequency works for a few users (5 or so), but then, with more users who authorized the same Microsoft application, the app seems to hit an application-level rate limit and begins receiving 429 Too Many Requests responses.
How can I ensure polling will still work as the number of users grows? And are there any rate limits that can be made public or shared in confidence for valid use cases?
So it is possible to register for webhooks on the sharepoint notebooks as onedrive items - as a notebook page gets updated the notificationUrl fires and you can then using delta calls to determine which sections (section.one files) have been updated.
I would then use the onenote-api to get the pages in the updated notebook sections GET https://www.onenote.com/api/v1.0/me/notes/sections/{id}/pages
An alternative would be to treat the sharepoint drive as a webdav server and use the propfind method with the getlastmodified property to poll the drive determine which sections of various notebooks have been updated.
But I agree it would be easier if onenote webhooks were extended to sharepoint.

Resources