Share A File

Title

Share a file with one or more users

URL Path

vault_rest/update_file_share

Method

POST

Summary

This API allows sharing a file in MetaDefender Vault.

HTTP header parameters

Authorization

The API key of the caller

REQUIRED

This header should have the following format:
Bearer [

Example: Bearer Cp01BwnXAIOLZXxn7yogjKqIZnZpQD

Method: POST

HTTP body

json formatted request

REQUIRED

HTTP body sample
{
"fileId": "849137c80bd443cca3c49328f4a32fe9",
"groupIds": [
19
],
"userIds": [
24
]
}

Description of request body

Name

Description

file_id

The GUID of the file uploaded

groupIds

The Ids of the groups to share with

userIds

The Ids of the users to share with

Request Error

400

Bad Request

Invalid HTTP request

401

Unauthorized

Authentication unauthorized

403

Forbidden

Permission denied

500

Internal Server Error

Server is temporarily unavailable

Response

In case of a successful request status code 200 will be returned and the body of the response can be ignored. This means that the file has been successfully shared.

Example of a failed request:

{
"message": "Failed to update file share information because specified user(s) collection is not correct. Please ensure that specified user(s) was not deleted.",
"ui_message_key": "API_FAILED_TO_UPDATE_FILE_SHARE_INVALID_USERS",
"status_code": "BadRequest"
}

Descriptions of response:

status_code

HTTP status code

message

A message describing the error

ui_message_key

A message key that is useful for localization