Add the power of the Box AI API to your custom apps at Content Cloud Summit on May 15

Learn more and register!

Copy file request

post
https://api.box.com/2.0
/file_requests/:file_request_id/copy

Copies an existing file request that is already present on one folder, and applies it to another folder.

Request

bearer [ACCESS_TOKEN]
application/json

Path Parameters

stringin pathrequired
123

The unique identifier that represent a file request.

The ID for any file request can be determined by visiting a file request builder in the web application and copying the ID from the URL. For example, for the URL https://*.app.box.com/filerequest/123 the file_request_id is 123.

Request Body

stringin bodyoptional
"Please upload required documents"

An optional new description for the file request. This can be used to change the description of the file request.

This will default to the value on the existing file request.

string / date-timein bodyoptional
"2020-09-28T10:53:43-08:00"

The date after which a file request will no longer accept new submissions.

After this date, the status will automatically be set to inactive.

This will default to the value on the existing file request.

objectin body

The folder to associate the new file request to.

stringin bodyrequired
"42037322"

The ID of the folder to associate the new file request to.

stringin bodyrequired
"folder"

folder

Value is always folder

booleanin bodyoptional
true

Whether a file request submitter is required to provide a description of the files they are submitting.

When this setting is set to true, the Box UI will show a description field on the file request form.

This will default to the value on the existing file request.

booleanin bodyoptional
true

Whether a file request submitter is required to provide their email address.

When this setting is set to true, the Box UI will show an email field on the file request form.

This will default to the value on the existing file request.

stringin bodyoptional
"active"

An optional new status of the file request.

When the status is set to inactive, the file request will no longer accept new submissions, and any visitor to the file request URL will receive a HTTP 404 status code.

This will default to the value on the existing file request.

Value is one of active,inactive

stringin bodyoptional
"Please upload required documents"

An optional new title for the file request. This can be used to change the title of the file request.

This will default to the value on the existing file request.

Response

application/jsonFile Request

Returns updated file request object.

application/jsonClient error

Returned when the access token provided in the Authorization header is not recognized or not provided.

application/jsonClient error

Returned if the user does not have all the permissions to complete the update.

  • access_denied_insufficient_permissions when the authenticated user does not have access to update the file request.
application/jsonClient error

Returned if the file request is not found, or the user does not have access to the associated folder.

application/jsonClient error

Returned if the file_request_id is not in a recognized format.

application/jsonClient error

An unexpected client error.

post
Copy file request
You can now try out some of our APIs live, right here in the documentation.
Log in

Request Example

cURL
curl -i -X POST "https://api.box.com/2.0/file_requests/42037322/copy" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -d '{
       "title": "Please upload required documents",
       "description": "Please upload required documents",
       "status": "active",
       "is_email_required": true,
       "is_description_required": false,
       "folder": {
         "id": "2233212",
         "type": "folder" 
       }
     }'
.NET
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);
Java
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");
Python
file_request = client.file_request(file_request_id='123456')
folder = client.folder(folder_id='123456789')
new_file_request = file_request.copy(folder=folder, title="Copied file request")
Node
client.fileRequests.copy(fileRequestId, {
  folder: {
    id: '157979815648',
    type: 'folder'
  }
}).then((r: FileRequest) => {
  // do something with the copied file request 
  console.log(r)
});
iOS
let destinationFolder = FolderEntity(id: "33333")

let copyRequest = FileRequestCopyRequest(
    title: "New file request title",
    description: "New file request description",
    isEmailRequired: true,
    isDescriptionRequired: false,
    folder: destinationFolder
)

client.fileRequests.copy(fileRequestId: "123456", copyRequest: copyRequest) { result in
    guard case let .success(fileRequest) = result else {
        print("Error copying file request")
        return
    }
    
    print("Copied file request title: \(fileRequest.title ?? "n/a"), description: \(fileRequest.description ?? "n/a")")
}
TypeScript (Beta)
await client.fileRequests.createFileRequestCopy(fileRequestId, {
  folder: {
    id: fileRequest.folder.id,
    type: 'folder' as FileRequestCopyRequestFolderTypeField,
  } satisfies FileRequestCopyRequestFolderField,
} satisfies FileRequestCopyRequest);
Python (Beta)
client.file_requests.create_file_request_copy(file_request_id, CreateFileRequestCopyFolder(id=file_request.folder.id, type=CreateFileRequestCopyFolderTypeField.FOLDER.value))
.NET (Beta)
await client.FileRequests.CreateFileRequestCopyAsync(fileRequestId: fileRequestId, requestBody: new FileRequestCopyRequest(folder: new FileRequestCopyRequestFolderField(id: fileRequest.Folder.Id, type: FileRequestCopyRequestFolderTypeField.Folder)));

Response Example

{
  "id": "42037322",
  "type": "file_request",
  "created_at": "2020-09-28T10:53:43-08:00",
  "created_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "description": "Following documents are requested for your process",
  "etag": "1",
  "expires_at": "2020-09-28T10:53:43-08:00",
  "folder": {
    "id": "12345",
    "type": "folder",
    "etag": "1",
    "name": "Contracts",
    "sequence_id": "3"
  },
  "is_description_required": true,
  "is_email_required": true,
  "status": "active",
  "title": "Please upload documents",
  "updated_at": "2020-09-28T10:53:43-08:00",
  "updated_by": {
    "id": "11446498",
    "type": "user",
    "login": "ceo@example.com",
    "name": "Aaron Levie"
  },
  "url": "/f/19e57f40ace247278a8e3d336678c64a"
}