WoodWing Help Center

Elvis 4 REST API - move / rename

Elvis 4 REST API - move / rename

GET/POST

http://yourserver.com/services/move
    ?source=<source path>
    &target=<destination path>
    &folderReplacePolicy=<AUTO_RENAME | MERGE | THROW_EXCEPTION>
    &fileReplacePolicy=<AUTO_RENAME | OVERWRITE
    | OVERWRITE_IF_NEWER | REMOVE_SOURCE
    | THROW_EXCEPTION | DO_NOTHING>
    &filterQuery=<query>
    &flattenFolders=<true|false>

What does it do?

Move or rename a folder or a single asset.

You can combine a rename operation and a move operation. Just specify the new target path.

When you move or rename a folder, all assets contained in the folder will also be moved to the new location. The subfolder structure will be kept intact.

Parameters

source

Either a folderPath or assetPath of the folder or asset to be moved or renamed.

Required

target

The folderPath or assetPath to which the folder or asset should be moved or renamed. If the parent folder is the same as in the source path, the asset will be renamed, otherwise it will be moved.

Required

folderReplacePolicy

Policy used when destination folder already exists.

  • AUTO_RENAME - add '-1' number to destination path. The counter is incremented until a free alternative is found.
  • MERGE - merge source folder into destination using fileReplacePolicy.
  • THROW_EXCEPTION - abort the operation.

Optional. If omitted, AUTO_RENAME will be used.

fileReplacePolicy

Policy used when destination asset already exists.

  • AUTO_RENAME - add '-1' number to destination path. The counter is incremented until a free alternative is found.
  • OVERWRITE - remove destination if it already exists.
  • OVERWRITE_IF_NEWER - only remove destination if source is newer. Otherwise remove source instead of moving it.
  • REMOVE_SOURCE - remove source if destination already exists.
  • THROW_EXCEPTION - abort the operation.
  • DO_NOTHING - skip move of the file.

Optional. If omitted, AUTO_RENAME will be used.

filterQuery

When specified, only source assets that match this query will be moved.

Optional. If omitted, all source assets will be moved.

flattenFolders

When set to true will move all files from source subfolders to directly below the target folder. This will 'flatten' any subfolder structure.

Optional. If omitted, folders will not be flattened.

async

When true, the process will run asynchronous in the background. The call will return immediate with the processId.

Optional. By default, the call waits for the process to finish and then returns the processedCount.

Return value

The operation returns a JSON object with the following properties:

processedCount Number of assets that were processed by the operation.
errorCount Number of errors that occurred.

If called with async=true, the operation returns a JSON object with the following properties:

processId Unique id of the process that was started.

If the operation fails, a JSON error object is returned.

Examples

Move single asset

The following moves an asset.

move

http://demo.elvisdam.com/services/move
    ?source=/Demo Zone/Images/Travel/Architecture/Louvre.jpg
    &target=/Demo Zone/Images/Travel/Cities/Louvre.jpg

It returns the following response.

{
  "processedCount" : 1
}

Rename single asset

The following renames an asset.

move
http://demo.elvisdam.com/services/move
    ?source=/Demo Zone/Images/Nature/Wildlife/Elephant Closeup.jpg
    &target=/Demo Zone/Images/Nature/Wildlife/African Elephant.jpg

Move folder

The following moves a folder and all the assets contained in it. The folder is also renamed.

move
http://demo.elvisdam.com/services/move
    ?source=/Demo Zone/Images
    &target=/Archive/2011/Demo Images
Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.