Table of contents
TOC
Collapse the table of content
Expand the table of content

ExternalSharingExtensions.CreateAnonymousLinkWithExpirationForDocument Method

SharePoint Dev Documents|Last Updated: 5/20/2017
|
1 Contributor

Creates anonymous link to the given document with automatic expiration time. See MSDN

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static string CreateAnonymousLinkWithExpirationForDocument(this Web web, String urlToDocument, ExternalSharingDocumentOption shareOption, DateTime expireTime)

Parameters

web

  Type: Microsoft.SharePoint.Client.Web
  Web for the context used for people picker search

urlToDocument

  Type: System.String
  Full URL to the file which is shared

shareOption

  Type: Microsoft.SharePoint.Client.ExternalSharingDocumentOption
  Type of the link to be created - View or Edit

expireTime

  Type: System.DateTime
  Date time for link expiration - will be converted to ISO 8601 format automatically

Return Value

Type: string
Anonymous URL to the file as string

See also

© 2018 Microsoft