0

From where i can get the official documentation from Microsoft regarding the "Sharelink" REST API endpoint specification, mainly the values and purpose of the parameters passed inside the body. as I can not find any official documentations. any advice please?

1- Method:- POST

2- URL:- _api/web/Lists('ListGUID')/GetItemByID('1')?['ID']}')/Sharelink

3- Body:-

{

    "request":{
        "createLink":true,
        "settings":{
            "allowAnonymousAccess":true,
            "linkKind":6,
            "role":1,
            "restrictShareMembership":false,
            "updatePassword":true,
            "password":"***",
            "scope":0
        }
    }
} 

now the above link will create an anonymous link with Read-only permission, but not sure how

1 Answer 1

1

I don't have the documentation for the endpoint directly. But since PNPjs is library that is mounted on top of the REST API, maybe you can find your answer by analyzing how the library calls at this endpoint:

https://pnp.github.io/pnpjs/sp/sharing/

Also, this is the most documentation I found about this endpoint on a Microsoft site: https://learn.microsoft.com/en-us/answers/questions/1282962/what-is-the-rest-api-endpoint-that-i-can-use-share

8
  • thanks a lot for the great links and help, will check them all. Commented May 13, 2023 at 15:00
  • But for example I used the browser developer tool to inspect the parameters that will be sent from the SharePoint UI when we share files using Anyone link or using "People you choose".. then i added those parameters to the custom REST API and it worked.. but can we guarantee that those parameters will not get changed in the future since there is not any official documentation about those parameters and the option we have.. did you get my point? Commented May 17, 2023 at 16:29
  • You cannot guarantee it won't change, because it's an endpoint on testing / beta phase. As Microsoft is telling in the documentation.
    – Vertamin
    Commented May 18, 2023 at 17:33
  • so how i can implement this requirement then inside my custom rest api? Commented May 18, 2023 at 17:54
  • also where did you find that it is on testing / beta phase? Commented May 18, 2023 at 18:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.