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

Notifications

Announcements

Community site session details

Community site session details

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

Another Alternate to Create Shareable Link

(0) ShareShare
ReportReport
Posted on by 11,413 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,413 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,413 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,413 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,413 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,413 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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard