Oskar Jensson Fjeld
Oskar Jensson Fjeld

Reputation: 743

Microsoft Graph API - Copying SharePoint file - Item not found

I'm working with Graph API against Microsoft Teams team's SharePoint site.

I'm following the example on this page (https://learn.microsoft.com/en-us/graph/long-running-actions-overview?tabs=http) and have an issue. I'm able to query the location provided by the copy endpoint and get a "Completed" status that also provides a ResourceId. But I'm unable to use this resource id in any queries and only getting "Item not found". Example of paths tried: /drives/{driveId}/items/{resource-id-returned-from-monitor-url} /groups/{groupId}/drive/items/{resource-id-returned-from-monitor-url}

The {driveID} is the driveId specified in the parentReference.DriveId in the copy file body.

I'm using the v1 Graph endpoint to get the file.

Btw, I can see the file fine in the correct folder within SharePoint.

Any ideas?

Regards, Oskar

Upvotes: 0

Views: 399

Answers (1)

Oskar Jensson Fjeld
Oskar Jensson Fjeld

Reputation: 743

I wasn't using the DriveId supplied by the /education/***/setUpResourcesFolder Location header but rather the Drive of the class. Fixed by using the driveId part of the Location URL.

Upvotes: 1

Related Questions