Make files on OneDrive/Sharepoint hidden through Graph API

Cavas, M (Martin) 41 Reputation points
2022-11-22T08:25:21.907+00:00

Hi Microsoft Community,

I am not particularly facing an issue but more of a real question if this is possible within the technological boundaries of Graph API.
Scenario:

I have manually created File A within Private Sharepoint Site. I do not want anyone including myself to visually see the file when the Sharepoint Site is opened through browser. But I do want it to be visible when browsing through Graph API calls. Can this be done?

Kind regards,
M

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
11,355 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,795 questions
0 comments No comments
{count} votes

Accepted answer
  1. CarlZhao-MSFT 39,821 Reputation points
    2022-11-22T10:44:53.727+00:00

    Hi @Cavas, M (Martin)

    Yes, this requirement can be realized.

    Go to your site's documents bar and create a custom column (hidden), then click Exit grid view and add parameters (can be any value) for your custom column.

    263061-page18.png

    263062-image.png

    Next, go to Settings>Library settings>More library settings>All Documents>Filter>OK.

    262930-image.png

    263071-image.png

    262959-image.png

    After setting the filter, no one (including yourself) can visually see the file when they open a SharePoint site, but you can still get it by calling the graph API.

    https://graph.microsoft.com/v1.0/sites/{site id}/drive/root/children  
    

    263046-image.png


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful