ListItemDriveItemContent is not working anymore

Loic DA SILVA (Cloud Admin) 20 Reputation points
2024-01-23T08:00:37.5633333+00:00

Hello, I am using the Graph API to download one a week a SharePoint file. This was working since a year but suddently I now have an error. The endpoint I use is: https://graph.microsoft.com/v1.0/sites/{{SideId}}/lists/{{ListId}}/items/{{ItemId}}/driveItem/content Now it returns me a 404 with the following response body:

{
  "error": {
    "code": "itemNotFound",
    "message": "Item not found"
  }
}
Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
9,939 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 34,621 Reputation points
    2024-01-23T08:30:02.9433333+00:00

    Hi @Loic DA SILVA (Cloud Admin)

    You should download drive items instead of list items, please change your API endpoint to the following:

    GET /sites/{siteId}/drive/items/{item-id}/content
    

    Hope this helps.

    If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.


0 additional answers

Sort by: Most helpful