PUT api/2.0/files/file/{fileId}/share
Sets sharing settings for the file with the ID specified in the request
Name |
Description |
Type |
Example |
fileId
sent in url
|
File ID
|
string
|
some text
|
share
sent in body
|
Collection of sharing rights
|
Collection of FileShareParamss
collection
|
share[0].ShareTo=9924256A-739C-462b-AF15-E652A3B1B6EB&share[0].Access=0
|
notify
sent in body
|
Should notify people
|
Bool value
|
true
|
sharingMessage
sent in body
|
Sharing message to send when notifying
|
string
|
some text
|
Each of the FileShareParams must contain two parameters: 'ShareTo' - ID of the user with whom we want to share and 'Access' - access type which we want to grant to the user (Read, ReadWrite, etc)
PUT api/2.0/files/file/some+text/share
Host: yourportal.onlyoffice.com
Content-Type: application/json
Accept: application/json
{
"share": [
{
"shareTo": "00000000-0000-0000-0000-000000000000",
"access": 0
}
],
"notify": true,
"sharingMessage": "some text"
}
application/json
{
"status": 0,
"response": [
{
"access": 1,
"sharedTo": {
"id": "00000000-0000-0000-0000-000000000000",
"displayName": "Mike Zanyatski",
"title": "Manager",
"avatarSmall": "url to small avatar",
"profileUrl": ""
},
"isLocked": false,
"isOwner": true
}
]
}
text/xml
<result>
<status>0</status>
<response>
<access>1</access>
<sharedTo>
<id>00000000-0000-0000-0000-000000000000</id>
<displayName>Mike Zanyatski</displayName>
<title>Manager</title>
<avatarSmall>url to small avatar</avatarSmall>
<profileUrl></profileUrl>
</sharedTo>
<isLocked>false</isLocked>
<isOwner>true</isOwner>
</response>
</result>