How to create a folder which is auto deleted after one week and is password protected?

Abid Hussain 46 Reputation points
2023-01-16T09:20:00.6666667+00:00

Hi all,

I have a C# Application and like to achieve the following:

  • Create a folder which is automatically deleted after a certain timespan (e.g. one week)
  • Make this folder password protected.

My intention is to provide limited access to certain files by external users.

I wonder if this is possible to achieve via Graph API?

Regards :-)

Microsoft Graph
Microsoft Graph
A Microsoft programmability model that exposes REST APIs and client libraries to access data on Microsoft 365 services.
12,002 questions
OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,110 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,685 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,912 questions
0 comments No comments
{count} votes

Accepted answer
  1. Srinivasa Rao Darna 6,721 Reputation points Microsoft Vendor
    2023-01-16T12:59:58.4966667+00:00

    Hello Abid Hussain,

    With Microsoft Graph createLink you can create sharable link with password and ExpirationDateTime, and external users can no longer access the file/folder using sharable link after expiration date, but the file/folder will not be deleted from source.

    Hope this helps.

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

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Abid Hussain 46 Reputation points
    2023-01-16T09:33:25.7+00:00

    Follow Up: I found how to share a folder and protect the share with a password:

    But still I wonder if it's possible to let the folder be automatically deleted after certain timespan ...?

    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.