IPWorks Cloud 2020 Node.js Edition

Questions / Feedback?

CopyResource Method

Copies a resource.

Syntax

box.copyResource(resourceId, parentId, newName, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err, data){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'data' is the value returned by the method.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method copies the resource specified by ResourceId to the folder specified by ParentId. The Id of the newly-copied resource is returned.

NewName specifies the name of the copied resource; if empty, the resource's original name is used. ParentId can also be empty, in which case the resource is copied to the root folder.

NewName must be no longer than 255 characters; may not contain /, \, non-printable ASCII characters, or trailing whitespace; and cannot be one of the special names . or ...

Note that copy operations for folders with greater than 500 children (counted recursively) are performed asynchronously; the server will return the Id of the newly-copied folder resource immediately while continuing to perform the copy operation over time. There is no way to monitor an asynchronous copy operation.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks Cloud 2020 Node.js Edition - Version 20.0 [Build 8265]