File Operations

Contents

Your apps can perform various file operations like rename, delete and move using the File Operation APIs. The My Cloud Home file management refers to the CURD (Create, Update, Read and Delete) operations of files and folders.

Renaming a file

You can rename a file or folder by using file-id. Change the 'name' of the file or folder you want to rename.


  POST /sdk/v2/files/{file-id}}/patch HTTP/1.1
  Host: Endpoint-URL
  Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9
  Content-Type: application/json
  {
    "name": "NewFileName"
  }

  HTTP/1.1 204 No Content

Moving a file

You can move a file or folder by using file-id. Change the 'parentID' of the file or folder you want to move.


  POST /sdk/v2/files/{file-id}}/patch HTTP/1.1
  Host: Endpoint-URL
  Authorization: Bearer 9e9d3d16-f9b1-43dc-8599-d1db6fcedfa9
  Content-Type: application/json
  {
    "parentID": "NewParentID"
  }

  HTTP/1.1 204 No Content

Deleting a file

You can delete any file or folder by using file-id. All files and subfolders will be deleted from the storage.


  DELETE /sdk/v2/files/Xz0BifISoTqy7vAJmkqW6hKBZn0O6-kP1JBS9dQ8 HTTP/1.1
  Host: Endpoint-URL
  Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciO

  HTTP/1.1 204 No Content

APIs

Have question about this section?