Skip to content

Latest commit

 

History

History
77 lines (57 loc) · 2.99 KB

file_requests.md

File metadata and controls

77 lines (57 loc) · 2.99 KB

File Requests

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

Get a File Request's Information

Calling getInfo() returns information on a file request.

BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.getInfo();

Copy a File Request's Information

Calling copyInfo(String folderId) copies an existing file request that is already present on one folder, and applies it to another folder. If you want to set certain fields of the newly copied file request when it is created, set those fields in the BoxFileRequest.Info that you pass into this method copyInfo(BoxFileRequest.Info info, String folderId).

BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.new Info();
fileRequestInfo.setDescription("Following documents are requested for your process");
fileRequestInfo.setIsDescriptionRequired(true);
fileRequestInfo.setStatus(BoxFileRequest.Status.ACTIVE);
fileRequestInfo = fileRequest.copyInfo(fileRequestInfo, "folderId");

Update a File Request's Information

Calling updateInfo(BoxFileRequest.Info info) updates a file request. This can be used to activate or deactivate a file request.

BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
BoxFileRequest.Info fileRequestInfo = fileRequest.new Info();
fileRequestInfo.setDescription("Following documents are requested for your process");
fileRequestInfo.setIsDescriptionRequired(true);
fileRequestInfo.setStatus(BoxFileRequest.Status.ACTIVE);
fileRequestInfo = fileRequest.updateInfo(fileRequestInfo);

Delete a File Request

Calling delete() deletes a file request permanently.

BoxFileRequest fileRequest = new BoxFileRequest(api, "id");
fileRequest.delete();