Create
Creates empty files and folders
Defined in: create.js.
| Constructor Attributes | Constructor Name and Description |
|---|---|
|
Create(paths, directoryId, verbose, fields)
For every path "paths", this endpoint creates an empty file or folder.
|
Class Detail
Create(paths, directoryId, verbose, fields)
For every path "paths", this endpoint creates an empty file or folder.
- Parameters:
- paths
- An array of paths to create [ "destination/path/NewDirectory/", "destination/path/NewFile.txt" ] Note: This call will recursively create any missing directories.
- directoryId
- anId of the root directory to create the paths in.
- verbose Optional, Default: false
- Setting this to true will collect a variety of default values for each asset.
- fields Optional
- An array of field id's to collect the values for each asset
- Returns:
- [{theCreatedItemsInfo}, ... ]
/wf/restapi/v2/create
Parameters:
paths=["destination/path/NewDirectory/","destination/path/NewFile.txt"]
Response:
[
{
"path": "destination/path/NewDirectory/"
},
{
"id": 201629298
}
]
/wf/restapi/v2/create
Parameters:
paths=["destination/path/NewDirectory/","destination/path/NewFile.txt"]
verbose=true
Response:
[
{
"path": "destination/path/NewDirectory/",
"name": "NewDirectory",
"resolver": "directory://247"
},
{
"id": 201629299,
"name": "NewFile.txt",
"path": "destination/path/NewFile.txt",
"height": 0,
"width": 0,
"bytes": 0,
"lastModified": 1507833926000,
"mimeType": "text/plain",
"previews": {
"thumbnail": "../servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323031363239323939",
"viewex": "../servlet/jb.view?table=viewex&col=viewex&id=pe_323031363239323939",
"downloadUrl": "../servlet/dload?id=pe_323031363239323939"
}
}
]
/wf/restapi/v2/create
In this example 123 is the directory id of the testFolder/ directory
Parameters:
paths=["destination/path/NewDirectory/","destination/path/NewFile.txt"]
directoryId=123
verbose=true
Response:
[
{
"path": "testFolder/destination/path/NewDirectory/",
"id": 404,
"parentId": 403,
"name": "NewDirectory",
"resolver": "directory://404"
},
{
"id": 202424640,
"name": "NewFile.txt",
"path": "testFolder/destination/path/NewFile.txt",
"directoryId": 403,
"height": 0,
"width": 0,
"bytes": 0,
"lastModified": 1551809299000,
"mimeType": "text/plain",
"previews": {
"thumbnail": "https://luke.brightech.com:55555/servlet/jb.view?table=thumbnails&col=thumbnails&id=pe_323032343234363430",
"viewex": "https://luke.brightech.com:55555/servlet/jb.view?table=viewex&col=viewex&id=pe_323032343234363430",
"downloadUrl": "https://luke.brightech.com:55555/servlet/dload?id=pe_323032343234363430"
}
}
]