Choose where you’d like to start

Share file

Note: As previously announced, Zoho Docs is being discontinued and the Deluge Docs integration tasks will stop executing starting 15th September 2023. For your advanced file management and collaboration requirements, we recommend you refer to the WorkDrive API documents as an alternative.

Overview

This task is used to share a specified file with other users.

Note: On average, it takes about a minute to index a file/folder after it is created or updated. This indexing time can increase if the queue size increases. You will not get the expected result if you execute zoho.docs.shareFile task before the file you need to share is indexed.

Syntax

<response> = zoho.docs.shareFile(<fileID>, <emailID>, <permission>, <notify>, <message>);

where,

ParameterDescriptionDescription

<response>

Variable which will hold the response returned by Zoho Docs.

KEY-VALUE

<fileID>

ID of the file which will be shared.

TEXT

<emailID>

Email address to which the file will be shared.

TEXT
(OR)
LIST

<permission>

(optional)

Applicable values are:

  • readonly
  • readwrite
  • coowner

TEXT

<notify>

(optional)

The value true will send an email notification to the user with whom the file has been shared.

By default, the value is false.

BOOLEAN
<message>
(optional)
Content of the notification email.TEXT

Example: Share a file

The following script shares the specified file in Zoho Docs with the specified user.

response= zoho.docs.shareFile("2cboca937f75ccbf9470191585448baa8d752", "john@zylker.com");

where,

"2cboca937f75ccbf9470191585448baa8d752"

is the ID of the file which will be shared.
"john@zylker.com"

is the email address of the user with whom the file will be shared.

Response

The success response returned is of the following format:

{  
   "response":[  
      "{\"uri\":\"/files/v1/share\"}",
      "{\"message\":\"SHARED_DOCUMENT_SUCCESS\"}",
      "{\"result\":[{\"shareduserlist\":\"xxx@zohocorp.com,\"}]}"
   ]
}

Get Started Now

Execute