Deluge Help

Share file

Overview

The zoho.docs.shareFile() task is used to share a file in your Zoho Docs account with other users of Zoho Docs. 

Syntax

<response> = zoho.docs.shareFile(<FiIeID>,<EmailID>,<Permission>,<Notify>,<message>);​

where,
response - response returned as map from Zoho Docs.
FileID - ID of the file to be shared. It is of string data type.
EmailID - Email address to which the file needs to be shared. It can be a single email id or a list of email ids' separated by a comma.
Permission - Permission for the shared doc. This is an optional param.
The following permissions are allowed:

  • readonly - Read Only permission
  • readwrite - Read and Edit permission
  • coowner - User with whom the file is shared becomes the co-owner of the file

Notify - Specify boolean value 'true' to send a notification email to the user with whom the file is shared. This is an optional param.
message - Content of the email. It is of string data type. This is an optional param.

Example

The following script shares the specified file with the specified users with the specified permissions.

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

where,
2cboca937f75ccbf9470191585448baa8d752 - is the id of the file which needs to be shared.
john@zohocorp.com - Email address to which the file needs to be shared.
readonly - Permission for the shared doc.
true - To send a notification email to the user with whom the file is shared.

Sample Response

The response returned is of the following format

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

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohocreator.com