web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Another Alternate to C...
Power Automate
Answered

Another Alternate to Create Shareable Link

(0) ShareShare
ReportReport
Posted on by 11,415 Moderator

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

 

 

Categories:
I have the same question (0)
  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @Mira_Ghaly , i didnt get the point "Duplicate Duplicate Libraries", can you please elaborate? and is that creating issue with creating sharing link?

  • Mira Ghaly Profile Picture
    11,415 Moderator on at

    @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?

     

  • Verified answer
    annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @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,415 Moderator on at

    @annajhaveri 

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

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    @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,415 Moderator on at

    @annajhaveri 

    Mira_Ghaly_0-1612265643921.png

    Yes i can do it via UI

     

    Thanks

     

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    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,415 Moderator on at

    @annajhaveri 

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

  • annajhaveri Profile Picture
    8,531 Most Valuable Professional on at

    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,415 Moderator on at

    @annajhaveri 

    Find below the screenshot:

    Mira_Ghaly_0-1612303554800.png

     

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 796

#2
Valantis Profile Picture

Valantis 568

#3
Haque Profile Picture

Haque 538

Last 30 days Overall leaderboard