Skip to content

Latest commit

 

History

History
74 lines (55 loc) · 2.41 KB

file-request.md

File metadata and controls

74 lines (55 loc) · 2.41 KB

File Requests

File request objects represent a file request associated with a folder.

Get a File Request's Information

Calling FileRequestsManager.GetFileRequestByIdAsync(string fileRequestId)returns information on a file request.

BoxFileRequestObject fileRequest = await client.FileRequestsManager.GetFileRequestByIdAsync("12345");

Copy a File Request's Information

Calling FileRequestsManager.CopyFileRequestAsync(string fileRequestId, BoxFileRequestCopyRequest copyRequest) copies an existing file request that is already present on one folder, and applies it to another folder.

var destinationFolder = new BoxRequestEntity
{
    Id = "123456",
    Type = BoxType.folder
};

var copyRequest = new BoxFileRequestCopyRequest
{
    Description = "New file request description",
    Folder = destinationFolder
};

BoxFileRequestObject fileRequest = await client.FileRequestsManager.CopyFileRequestAsync("12345", copyRequest);

Update a File Request's Information

Calling FileRequestsManager.UpdateFileRequestAsync(string fileRequestId, BoxFileRequestUpdateRequest updateRequest) updates a file request. This can be used to activate or deactivate a file request.

var updateRequest = new BoxFileRequestUpdateRequest
{
    Description = "New file request description",
    Status = BoxFileRequestStatus.inactive
};

BoxFileRequestObject fileRequest = await client.FileRequestsManager.UpdateFileRequestAsync("12345", updateRequest);

Delete a File Request

Calling FileRequestsManager.DeleteFileRequestAsync(string fileRequestId) deletes a file request permanently.

bool isSuccess = await client.FileRequestsManager.DeleteFileRequestAsync("12345");