Skip to content

Latest commit

 

History

History
84 lines (63 loc) · 2.98 KB

file_requests.md

File metadata and controls

84 lines (63 loc) · 2.98 KB

File Requests

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

Get a File Request's Information

Calling fileRequests.getById(fileRequestId: string) returns information on a file request FileRequest.

client.fileRequests.getById(fileRequestId)

Copy a File Request's Information

Calling fileRequests.copy(fileRequestId: string, copyBody: FileRequestCopyBody) 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 FileRequestCopyBody that you pass into copy method.

client.fileRequests.copy(fileRequestId, {
  folder: {
    id: '157979815648',
    type: 'folder'
  }
}).then((r: FileRequest) => {
  // do something with the copied file request 
  console.log(r)
});

Update a File Request's Information

Calling fileRequests.update(fileRequestId: string, updateBody: FileRequestUpdateBody) updates a file request. This can be used to activate or deactivate a file request using FileRequestUpdateBody that you pass into update method.

client.fileRequests.update(fileRequestId, {
  title: 'Updated title'
}).then((r: FileRequest) => {
  // do something with the updated file request 
  console.log(r)
});

Delete a File Request

Calling fileRequests.delete(fileRequestId: string)]delete deletes a file request permanently.

client.fileRequests.delete('2484517969').then(() => console.log('Removed file request'));