trying to get recycle bin with msGraph results in error 400

Rémi Picot 0 Reputation points
2025-02-19T10:35:37.7633333+00:00

Hello there, I'm trying to use msGraph to get the content of a recycle bin

I'm using a request like this using app permitions

GET /storage/fileStorage/containers/{containerId}/recycleBin/items

On the {containerId} I put my driveId

I tried directly with a curl like request and with the latest version of the official java connector to msgraph.

Do anyone manages to make it work ?

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
13,113 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,321 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Yakun Huang-MSFT 10,400 Reputation points Microsoft Vendor
    2025-02-20T07:24:07.36+00:00

    Hello Rémi Picot,

    Thank you for reaching out to Microsoft Support!

    For this endpoint, when you send a request, the value of {container_id} cannot be filled in as drive_id, it should be the id of the container.

    You can get the id of the container through the List containers endpoint, see the document for details:

    https://learn.microsoft.com/en-us/graph/api/filestorage-list-containers?view=graph-rest-1.0&tabs=http

    Hope this helps.

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

    0 comments No comments

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.