The API is very slow in detecting some changed to drives and file items.

Thomas Schneider 15 Reputation points
2023-08-22T09:37:55.2+00:00

I find that the Files API is very slow in detecting changes to a drive / drive items, like up to 10 minutes.

I have a situation where I use the File API call to copy a file (workbook) on a SharePoint drive, https://learn.microsoft.com/en-us/graph/api/driveitem-copy?view=graph-rest-1.0&tabs=http. The call works fine and with 10-20 seconds of the call, I can refresh the web page ant eh new file shows up in the folder.

I find that the Location URL returned by the Copy call is bogus. It does not working. It give some unauthorized response. But it is beta, so that is okay.

So to find out when the copy is done I use the search call, https://learn.microsoft.com/en-us/graph/api/driveitem-search?view=graph-rest-1.0&tabs=http. It works, but is very slow. It takes from anywhere between 5 and 10 minutes, before the search finds the file.

Is there a way to get the response faster? It must be possible, since the web interface can do it.

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,480 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.