This endpoint allows users to delete and rename files and packages.

Note: Any endpoint that begins with "/api/users/" (unless it's in the form "/api/users/me/") is accessible to admins only. The identifier me—indicating that the user is accessing data within their own domain of privileges, only—can be substituted for {user_id} or {dropbox_id} in the request.

Common Error Codes

  • 404 No Content - Package not found; returns an error object
  • 400 Bad Request - Request parameters are invalid; returns an error object
  • 500 HTTP Internal Server Error - Request is valid but the server encountered an error; returns an error object

Delete the files and folders from a package

POST /api/users/{user_id}/packages/{package_id}/delete_contents

This method deletes files and folders from a Faspex package.

Query Parameters: None

Request Parameters

Parameter Name Required/Optional Type Description
path required string The directory path for the package from which the contents are deleted.

Request Body:

{“paths”: 
[“path_1”, “path_2”]
}

Success Response Code

  • 200 OK - Returned with an array of path locations for deleted files and packages

Success Response Example

Note: The error code "404 Not Found" may be located within the response body if one deletion in the original request is successful, but the other deletion fails, because the deletion path does not exist (as in the example below).

[
{"path":  "successfully/deleted/path"},
{"path":  "failed/deletion/path",
 "error": 
 	{"code": 404,
  	"reason": "Not Found",
  	"user_message": "No such file or directory"}}
]

Rename package contents

POST /api/users/{user_id}/packages/{package_id}/rename_contents

This method renames files and folders in a Faspex package.

Query Parameters: None

Request Body:

{“paths”: [
{"source": "file.txt", "destination": "file_renamed.txt"},
{"source": "folder", "destination": "folder_renamed"}
]	
}

Success Response Code

  • 200 OK - Returned with an array of renamed package information

Success Response Example

Note: A "successful" response may contain 404 errors as part of the array.

 [{"path": 
 	"/Package - f199fe6c-e0fd-4510-b9c9-03e69819db58.aspera-package/PKG - Package",
	"source": "file.txt",
	"destination": "file_renamed.txt",
	"error": 
 	{"code": 404, "reason": "Not Found", "user_message": "Source not found"}},
   {"path": 
 	"/Package - f199fe6c-e0fd-4510-b9c9-03e69819db58.aspera-package/PKG - Package",
	"source": "folder",
	"destination": "folder_renamed"}]

Video player

Video

×