A user who is a member of a workspace can send and receive packages within the context of that workspace. Packages can also be archived, and the sender of a package can delete it.

Calling GET on /packages will return all packages that the user has sent or received. Various filters can be applied as well. See API | Packages.

For example, to list all received packages that have not been archived, make the following request:

GET /packages?archived=false&received=true
200 OK
[
  {
    "active_download_count": null,
    "archived": false,
    "average_rate": 51.0876,
    "bytes_transferred": 758,
    "complete": true,
    "completed_at": "2016-01-20T01:34:58.000Z",
    "contents_file_id": "138",
    "created_at": "2016-01-20T01:34:54.000Z",
    "deleted": false,
    "deleted_at": null,
    "deleted_by_admin": false,
    "deleted_by_user_id": null,
    "expired": false,
    "expired_at": null,
    "failed": false,
    "failed_download_count": null,
    "files_completed": 1,
    "files_expected": 1,
    "file_count": 1,
    "file_id": "137",
    "folders_completed": 0,
    "folders_expected": 0,
    "full_download_count": null,
    "has_content": true,
    "id": "BvrieVg",
    "metadata": null,
    "name": "Maximum Justice Trailer",
    "node_id": "1",
    "note": "Here's the trailer that you asked for!",
    "partial_download_count": null,
    "read": false,
    "received": true,
    "sender": {
      "email": "esalazar@mammothstudios.com",
      "id": "16",
      "name": "Elsa Salazar",
      "type": "user"
    },
    "sent": false,
    "sent_at": "2016-01-20T01:34:54.000Z",
    "size": 758,
    "time_remaining": 0.0,
    "transfers_expected": 1,
    "workspace_id": "1",
    "recipients": [{
      "email": "mreynolds@mammothstudios.com",
      "id": "15",
      "name": "Matthew Reynolds",
      "type": "user"
    }]
  }
]

To view or download package contents, access the files on the node using the returned node_id and file_id.

To send a package, start by creating a package into which files can be uploaded.

POST /packages
{
  "file_names": ["info.txt"],
  "name": "Here are the files you asked for",
  "note": "",
  "recipients": [{
    "type": "user",
    "id": "16"
  }],
  "workspace_id": "1"
}
201 Created
{
  "active_download_count": null,
  "archived": false,
  "average_rate": null,
  "bytes_transferred": null,
  "complete": false,
  "completed_at": null,
  "contents_file_id": "142",
  "created_at": "2016-01-20T01:50:40.000Z",
  "deleted": false,
  "deleted_at": null,
  "deleted_by_admin": false,
  "deleted_by_user_id": null,
  "expired": false,
  "expired_at": null,
  "failed": false,
  "failed_download_count": null,
  "files_completed": 0,
  "files_expected": null,
  "file_count": null,
  "file_id": "141",
  "folders_completed": null,
  "folders_expected": null,
  "full_download_count": null,
  "has_content": true,
  "id": "DuuXzLA",
  "metadata": null,
  "name": "Here are the files you asked for",
  "node_id": "1",
  "note": "",
  "partial_download_count": null,
  "read": false,
  "received": false,
  "sender": {
    "email": "mreynolds@mammothstudios.com",
    "id": "15",
    "name": "Matthew Reynolds",
    "type": "user"
  },
  "sent": false,
  "sent_at": null,
  "size": null,
  "time_remaining": null,
  "transfers_expected": null,
  "workspace_id": "1",
  "recipients": [{
    "email": "esalazar@mammothstudios.com",
    "id": "16",
    "name": "Elsa Salazar",
    "type": "user"
  }]
}

The created package contains a node_id and contents_file_id, and package content should be uploaded into the file specified by these.

Here is an example of how to start an upload into the package using Connect.

POST /v5/connect/transfers/start
Host: 127.0.0.1:33003
{
  "transfer_specs": [{
    "transfer_spec": {
      "authentication": "token",
      "direction": "send",
      "paths": [{
        "source": "/Users/jimsong/Desktop/info.txt"
      }],
      "remote_user": "xfer",
      "remote_host": "api.f4.vm",
      "resume": "sparse_checksum",
      "save-before-overwrite": true,
      "ssh_port": 33001,
      "tags": {
        "aspera": {
          "node": {
            "file_id": "142",
            "access_key": "yEpmWlN9vFMZD0cC5W1pn1kyWxC5_QiP0BZAcRZHAsYA"
          },
          "files": {
            "package_id": "DuuXzLA",
            "package_operation": "upload"
          }
        }
      },
      "token": "Bearer eJwV0EmvokAABOA7P4Or7400m0LioUVpUVBpWbRfJgabFlxYFFvFyfz3YY6VVL5K6o/IG3bfn1LRFIEmfokNrWrWhbJK2a92WhfxdWk8bY9MJGppMahLcGnjt6Xt/dNaGhNIMZnBZgfN/5CZXK8dwt716c6affLoJFkC+rcEvuVBIAFT0UwASNfJ7hWvu+FGNH9EIP7+K4xGGwctYRDi6WgkPNbXvspeR2erIDdHVQlVI8A3Fc0aT6XbfhpWdLVj9/hcLj8KfqxfPd3Sk4l7IHPBcBeBkoQZBn5tZVND78uHc74dG57FQ/7E9qQEOj/bCk2AwcgRr2acp2+0JiQUNhIDrFWU5/FVFIu3m07UWNVOpTpRpGy4aOFnsM1r94UrhaKPAudSj9s58bwLJoIcHXxjlfO6hslay8ojJjbZLT4+CnaG40qXWIuQZaw4aAM4lKKSUQemQwz9KBO8lx/mjl0s1NiWi3B+ozHdzOySqJ8bDYM0uw0zotQ8o7TFd7knpxEJ1GcxfaOxgAaodnT5NFhBhz92eMiCLHm4SU9Gad815m4Zqbm2PDK/e/cfv2afAw=="
    },
    "aspera_connect_settings": {
      "allow_dialogs": false,
      "app_id": "aspera_15",
      "request_id": "000b8fec-5177-4449-aba5-07b443dbc939",
      "back_link": "https://mammoth.f4.vm/workspaces/1/packages/received"
    }
  }],
  "aspera_connect_settings": {
    "app_id": "aspera_15"
  }
}

Note that the transfer needs to be tagged with the package ID, otherwise package completion and statistics will not record properly.

At any point during or after the transfer, mark the package as sent. This finalizes the package and prevents it from being modified further. The recipients will not receive the package until it is marked as sent and all expected uploads are complete.

PUT /packages/DuuXzLA
{
  "sent":true,
  "transfers_expected":1
}
Video player

Video

×

Reset your Password Password resets are handled on the Support Site

×