Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Building Flows
Answered

Another Alternate to Create Shareable Link

(0) ShareShare
ReportReport
Posted on by 11,409 Super User 2025 Season 1

Hello,

 

I have an issue with using the below Action, so basically the issue is that i have Duplicate Duplicate Libraries I know it is weird but it is the case , so the create sharing link fails as it picks the empty Library , so i need to find a way to apply the external sharing using API , or by Passing the whole file path instead of Item ID / and Relative URL

Mira_Ghaly_0-1612247986239.png

 

 

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

    I tried again this morning and it worked ... Thanks for your amazing Support !

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

    Find below the screenshot:

    Mira_Ghaly_0-1612303554800.png

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at
    Re: Another Alternate to Create Shareable Link

    No worries, there must be a solution, can you share the screenshot of the HTTP action that you have configured in the flow for sharing link?

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

    Yes my account and have access .. I experience all kinds of strange 🙂

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at
    Re: Another Alternate to Create Shareable Link

    Okay, thats strange, the account used in the flow is your account or some other account? Does that account has access to create the anyone link?

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

    Mira_Ghaly_0-1612265643921.png

    Yes i can do it via UI

     

    Thanks

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at
    Re: Another Alternate to Create Shareable Link

    @Mira_Ghaly  are you able to create the anyone link from the UI? If sharing with anyone enabled? can you share the screenshot of error?

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

    Thanks for your help and effort ; I have tried second solution and it is give me Unauthorized. Any clues?

     

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on at
    Re: Another Alternate to Create Shareable Link

    @Mira_Ghaly  below are two ways using REST API you can create the anyone sharing link

     

    1. Using List GUID and Item ID, see screenshot below:

    annajhaveri_0-1612262330925.png

    Uri: _api/web/lists(guid'A4E78CC7-F74F-4733-832A-099D945908A8')/items(39)/sharelink 

    Here replace 'A4E78CC7-F74F-4733-832A-099D945908A8' with your list GUID and replace 39 with your item id

     

    Body

    {
     "request":
     {
     "createLink":true,
     "settings":
     {
     "allowAnonymousAccess":true,
     "linkKind":2,
     "expiration":null,
     "restrictShareMembership":false,
     "updatePassword":false,
     "password":"", 
     "description":"My description", 
     "role":8,
     "applicationLink":false,
     "limitUseToApplication":false
     }
     }
    }

     

    2. Use File URL

    Screenshot 2021-02-02 161510.png

     

    Uri: _api/web/GetFileByUrl(@v)/ListItemAllFields/ShareLink?@v='/sites/development/Shared%20Documents/book1.xlsx'

    Replace '/sites/development/Shared%20Documents/book1.xlsx' with your file URL

     

    Body parameter value is same as above.

     

    To get just Document Library regardless of whether it has files or not, you can use below Rest API 

    Screenshot 2021-02-02 161740.png

     

    if you want to get Document Library by ID you can use below URI, just replace List GUID with your List GUID

    _api/web/lists(guid'A4E78CC7-F74F-4733-832A-099D945908A8')

     

  • Mira Ghaly Profile Picture
    11,409 Super User 2025 Season 1 on at
    Re: Another Alternate to Create Shareable Link

    @annajhaveri 

     

    Yes unfortunately i am using a flow to create document libraries and this for some unknown reason creates duplicate sharepoint libraries with the same name and the Action for shareable link takes Library Name and Item Id, but can't reach the document library with the file in it.

     

    Another Question is there a way to get document libraries with 0 files in it?

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >