Shared links (anonymous access) (IRPCSharedLinksPublic)

View as Markdown

Opens and downloads files through shared links, without logging in.

gRPC serviceMFiles.IRPCSharedLinksPublic
Book and levelVault API, standard
Methods7
Proto filemfiles/IRPCSharedLinksPublic.proto

Overview

The anonymous side of shared links: opens and downloads a file shared with CreateSharedLink. No login and no session are needed; every call names the vault by its GUID and the link by its access key. Use it to build a download page for people outside the vault.

Public read-only link (SHARED_LINK_TYPE_READ_ONLY, or an external link open to anyone):

  1. GetSharedLinkInfo for the file name, extension and size.
  2. DownloadSharedFile_Begin for a download ID, the size and the MD5 checksum.
  3. DownloadSharedFile_ReadBlock in a loop until all bytes are read.

Link shared with named visitors (visitor links, and external links that are not open to anyone): the visitor proves their email address first.

  1. AccessSharedLink with the visitor's email address returns an access session value. If the address is a recipient of the link, the server emails an access code to it.
  2. Pass the address, the access code and the access session in additional_data of GetSharedLinkInfo and DownloadSharedFile_Begin, as NamedValue entries named RECIPIENT_EMAIL, RECIPIENT_ACCESSCODE and ACCESS_SESSION. Without them, an external link that is not open to anyone fails with "Authentication required to access the shared link.".

Shared links must be enabled on the server and in the vault. An unknown, deleted or expired access key fails with "The link is either expired or invalid.". The upload and WOPI methods serve co-authoring and Office for the web in M-Files clients; applications rarely call them.

Methods

MethodSummaryFacts
AccessSharedLinkStarts a visitor's access to a link shared with named visitors: returns an access session value and, if the email address is a recipient of the link, emails an access code to it.write no session
DownloadSharedFile_BeginStarts downloading the file of a shared link, without logging in, and returns a download ID, the file size and its MD5 checksum.write no session
DownloadSharedFile_ReadBlockReads one block of a file download started with DownloadSharedFile_Begin.write no session
GetSharedLinkInfoGets the name, extension and size of the file that a shared link points to, without logging in.write no session
GetWOPIFileInfoGets information about the file of a link for Office for the web (WOPI) operations. Used by M-Files clients; applications rarely call it.write no session
UploadSharedFileUploads a block of new content for a file opened for editing in Office for the web. Used by M-Files clients; applications rarely call it.write no session
UploadSharedFileCommitCompletes an upload made with UploadSharedFile and stores the content in the checked-out file. Used by M-Files clients; applications rarely call it.write no session