Share via


Web.CreateAnonymousLink method

Create an anonymous link which can be used to access a document without needing to authenticate.

Namespace:  Microsoft.SharePoint.Client
Assembly:  Microsoft.SharePoint.Client (in Microsoft.SharePoint.Client.dll)

Syntax

'Declaration
Public Shared Function CreateAnonymousLink ( _
    context As ClientRuntimeContext, _
    url As String, _
    isEditLink As Boolean _
) As ClientResult(Of String)
'Usage
Dim context As ClientRuntimeContext
Dim url As String
Dim isEditLink As Boolean
Dim returnValue As ClientResult(Of String)

returnValue = Web.CreateAnonymousLink(context, _
    url, isEditLink)
public static ClientResult<string> CreateAnonymousLink(
    ClientRuntimeContext context,
    string url,
    bool isEditLink
)

Parameters

  • url
    Type: System.String

    The URL of the site, with the path of the object in SharePoint represented as query string parameters, forSharing set to 1 if sharing, and mbypass set to 1 to bypass any mobile logic. For example:

    https://contoso.com/?forSharing=1&mbypass=1&List=%7BCF908473%2D72D4%2D449D%2D8A53%2D4BD01EC54B84%7D&obj={CF908473-72D4-449D-8A53-4BD01EC54B84},1,DOCUMENT
    
  • isEditLink
    Type: System.Boolean

    If true, the link will allow the guest user edit privileges on the item.

Return value

Type: Microsoft.SharePoint.Client.ClientResult<String>
The string for the anonymous link.

See also

Reference

Web class

Web members

Microsoft.SharePoint.Client namespace