Create

Create a new folder on a specified node.

Request

POST https://api.cloudplan.biz/api/file/create

{
    "node_id":"..."       // (string, semi-optional) the node where the
                          folder should be created - if not specified the
                          parent_id will be used to determine a suitable node
    "folder_name":"..."   // (string, required) the name of the folder to create
    "parent_id":"..."     // (semi-optional) leave empty when creating a new
                            root-level folder
}

Note: either node_id or parent_id have to exist. If only the parent_id exists a node will be picked automatically.

Reply

{
    "result": true
    "reason": any of the error codes below
    "folder_id":"..."       // (string) id of the created folder
}

Error Codes

no_parent_id_and_no_node_id
no_node
folder_name_empty
user_has_no_access
folder_already_exists
user_cannot_access_node

error codes from :doc:`api/user/login`