Skip to content

Downloads

The agent can download any MASV package providing that you have a valid download URL in the format https://get.massive.app/{ID}?secret={SECRET}. For password-protected downloads, you also need to provide the password. The agent rebuilds the directory structure of the package as sent by the sender. Initiating and managing downloads does not require a user session.

Please not that cross-platform downloads can cause issues with special characters not being accepted by certain platforms, so the agent will remove any special characters from file names if they were not allowed on the target platform.

Similar to uploads, downloads transition through different state throughout their lifecycle, with the exception that downloads do not go through an idle state, but transition to complete immediately once all data is transferred. Downloads can be in one of the following states:

  • transferring: the download is currently transferring (downloading) data.
  • paused the download is paused by the user.
  • complete: the download has been completed.
  • error: a fatal error was encountered and the download had to stop. This might or might not be recoverable, depending on the type of error.

Download a package

To initiate a package download, simply supply the full download link URL to the agent along with a destination folder in your computer to store the downloaded files:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/downloads -d '{
  "url":"https://get.massive.app/LINK_ID?secret=LINK_SECRET",
  "dst_folder":"/destination/folder",
  "password": "optional_password"
}'

Where:

  • url is the full download link sent to you by the sender or obtained from the web UI.
  • dst_folder is the destination directory to download files into.
  • password is the download password, which is only required if the link was password-protected.

If successful, the agent will respond with a JSON object that indicates the newly created download_id that can be used to query or modify the download state.

View download status

To list all downloads managed by the agent:

curl -X GET http://localhost:8080/api/v1/downloads

In order to view the full details for a specific download (including individual file states), use the following request:

curl -X GET http://localhost:8080/api/v1/downloads/{DOWNLOAD_ID}

Manage downloads

To pause a download, call:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/downloads/{DOWNLOAD_ID}/pause

To resume a download:

curl -X POST -H "Content-Type: application/json" http://localhost:8080/api/v1/downloads/{DOWNLOAD_ID}/resume

To delete a download, regardless of what state it was in:

curl -X DELETE http://localhost:8080/api/v1/downloads/{DOWNLOAD_ID}

Please note that deleting a download this way does not automatically delete the completed files from the file system. If you want to delete a download record and delete all files from the filesystem at the same time, you can do so by calling:

curl -X DELETE http://localhost:8080/api/v1/downloads/{DOWNLOAD_ID}?remove_files=true

To delete all downloads, regardless of state:

curl -X DELETE http://localhost:8080/api/v1/downloads

To delete all downloads of a particular state ("paused", "transferring", "complete", "error"), specify the states as a url parameter:

curl -X DELETE http://localhost:8080/api/v1/downloads?states=complete

The states value is a comma separated list, so users can delete downloads of multiple states with the same command:

curl -X DELETE http://localhost:8080/api/v1/downloads?states=complete,transferring

To additionally remove the downloaded files associated with the download, add the boolean url parameter remove_files:

curl -X DELETE http://localhost:8080/api/v1/downloads?remove_files=true

Users can combine these two url parameters:

curl -X DELETE http://localhost:8080/api/v1/downloads?states=complete,transferring&remove_files=true