A package is a bundle of files and folders (like a ZIP file or TAR file). Packages can be sent to people. Files and folders, on the other hand, can be shared with other people; when a File or Folder is sent to someone, it is put into a Package.

There are essentially two ways to send a Package:

  1. Create a Package, put files/folders in it, then send it.
  2. Create a Package, then let Files automatically send it after files/folders finish "transferring" into the Package.

2. Telling Files to send a Package once all transfers finish

If a client wants Files to automatically send a Package when all transfers into the Package complete:

  1. transfers must be tagged with {"aspera": {"files": {"package_id": the-package-id}}}, and
  2. the Package&39;s transfers_expected property must be set to the number of transfers at the time of sending "sent": true.

For example:

  1. Create a Package (POST to /packages)
  2. Start to transfer Files and Folders into the Package
  3. Before the transfer finishes the client can PUT {"sent": true, "transfers_expected": 1}. This tells Files to automatically send the package when that 1 transfer has finished.

Properties:

  • active_download_count - (read-only)
  • archived
  • average_rate - (read-only) in kbps
  • bytes_transferred - (read-only)
  • complete - (read-only) whether all transfers into the package have completed successfully and all contents are present
  • content_expires_at - (read-only) When contents should expire according to policy
  • content_retention_duration - in seconds, must be more restrictive than workspace settings (read-write)
  • contents_file_id - (read-only) the location of the "contents" folder in the Package. This is the folder that will contain all the files and folders that are being sent.
  • created_at - (read-only) when the package was created
  • delete_package_content_after_download_duration - in seconds, must be more restrictive than workspace settings(read-write)
  • deleted - (read-only) if package was deleted
  • deleted_at - (read-only) when the package contents were deleted
  • deleted_by_admin - (read-only)
  • deleted_by_user_id - (read-only)
  • expired_at
  • expired
  • failed_download_count - (read-only)
  • failed - (read-only)
  • file_count - (read-only) total number of files in the package, if available
  • file_id - (read-only) the location of the folder containing the top-level .asp-package folder on the node
  • files_completed - (read-only)
  • files_expected - (read-only)
  • folders_completed - (read-only)
  • folders_expected - (read-only)
  • full_download_count - (read-only)
  • id - (read-only) a short, unique string that also corresponds with the the name of the top-level .asp-package folder on disk
  • message_id - (read-only) A custom Message of type "package" that will be sent instead of the default system-generated Message. To associate a message with this package, create a message referencing this package.
  • metadata - JSON array containing an ordered list of metadata
  • name - (required) name with illegal characters stripped out or substituted
  • node_id - (read-only)
  • note
  • partial_download_count - (read-only)
  • read
  • received - (read-only)
  • recipients
  • sender
  • sent (read-only, except when setting to true on a draft package). Set this to true to "freeze" the Package and send its Message to the recipients.
  • sent_at - (read-only) when the package was sent
  • size - (read-only) total size of the package in bytes, if available
  • time_remaining - (read-only) in seconds
  • workspace_id - specifies the workspace this package belongs to, if any

Query Parameters (for GET):

  • archived
  • completed_at
  • complete
  • deleted
  • dropbox_id
  • embed%5B%5D=message
  • embed%5B%5D=node
  • embed%5B%5D=organization
  • embed%5B%5D=workspace
  • expired
  • failed
  • name
  • q - Search package_addressees.email, package_addressees.first_name, package_addressees.last_name, packages.name
  • read
  • received
  • sent_at
  • sent
  • size
  • workspace_id

Notes

  • The folder structure of a package on disk is as follows:
    • {id}.asp-package
      • contents
        • contained files and folders go here
      • metadata and other package-related files can go here
  • Uploads of package content should go directly into the named, innermost folder.
  • Downloads of the entire package should be of the named, innermost folder (renamed on download to the package name itself).
  • To get package transfers to properly register, they should be tagged as follows: {"faspex4": {"package": {"id": id}}}

GET and POST

GET, PUT, DELETE

POST /api/v1/packages
{
  "recipients": [{"type": "user", "id": "3"}],
  "name": "Vacation",
  "metadata": [
    {"name": "Location", "values": ["Hawaii"]},
    {"name": "Date", "values": ["3/21/2015"]}
  ]
}
201 Created
{
  "id":"1xaEzw",
  "created_at":"2014-04-15T18:51:32.137Z",
  "sender":{
    "id":"2",
    "name":"Jacob Erlich",
    "email":"jacob@asperasoft.com",
    "type" :"user"
  },
  "recipients": [{
    "type":"user",
    "id":"3",
    "name":"Jimmy Song",
    "email":"jimmy@asperasoft.com"
  }],
  "name":"Vacation",
  "metadata": [
    {"name": "Location", values: ["Hawaii"]},
    {"name": "Date", values: ["3/21/2015"]}
  ],
  "sent":false,
  "received":false,
  "archived":false,
  "read":false,
  "complete":false,
  "failed":false
}

Marking the package as sent:

PUT /api/v1/packages/1xaEzw
{
  "sent":true,
}
204 No Content

After composing and sending a message about this package and completion of upload:

GET /api/v1/packages/1xaEzw
200 OK
{
  "id":"1xaEzw",
  "created_at":"2014-04-15T18:51:32.137Z",
  "sender":{
    "id":"2",
    "name":"Jacob Erlich",
    "email":"jacob@asperasoft.com",
    "type" :"user"
  },
  "recipients": [{
    "type":"user",
    "id":"3",
    "name":"Jimmy Song",
    "email":"jimmy@asperasoft.com"
  }],
  "name":"Vacation",
  "sent":true,
  "received":false,
  "archived":false,
  "read":false,
  "complete":true,
  "failed":false
  "message_id":"37"
  "size":10245312,
  "file_count":207,
  "full_download_count": 3,
  "partial_download_count": 2,
  "failed_download_count": 0,
  "active_download_count": 3,
}

The Download Count resource is a read-only aggregate metric containing the number of downloads/copies a user has done.

Properties

  • active
  • failed
  • full
  • package_id
  • partial
  • user_id

Examples

GET /package/{id}/download_counts
200 Ok
[
  {
    "package_id": "1xaEzw",
    "user_id": "2345x",
    "partial": 5,
    "full": 0,
    "failed": 3,
    "active": 92182
  },
  {
    "package_id": "1xaEzw",
    "user_id": "1XrL",
    "partial": 5,
    "full": 0,
    "failed": 3,
    "active": 92182
  }
]
Video player

Video

×

Reset your Password Password resets are handled on the Support Site

×