Skip to content

Package Management

The MASV API allows authorized users to manage packages that have been sent and received under their account. Packages received via Portals are discussed in detail in the Portals section, but can be managed the same as a Sent Package.

Listing Sent Packages

Authorized users can retrieve a list of all packages that have been sent by a team that they belong to (subject to access policy). Results can be refined based on the package status.

GET /teams/{{team_id}}/packages

HEADERS
Name Type Required Description
X-User-Token String Yes User JSON Web Token
Content-Type String Yes Must be application/json
QUERY PARAMETERS
Name Type Required Description
expired bool No If expired packages should be included in response
finalized bool No If finalized packages should be included in response
new bool No If new packages should be included in response
archived bool No If archived packages should be included in response

Note

The expired, finalized, new and archived parameters are optional and allow for filtering the package list to include packages in these states. If none of them are passed or all are set to 0 then only packages in the finalized and expired states will be returned.

REQUEST
curl -H "X-User-Token: $USER_TOKEN" -H "Content-Type: application/json" -X POST https://api.massive.app/v1/teams/$TEAM_ID/packages

Where:

  • $USER_TOKEN is the auth token returned during auth request (refer to Authorization: Login section of this document)
  • $TEAM_ID is the team ID returned during auth request (refer to Authorization: Login section of this document)
  • $METHOD is either POST or PUT

After a successful request, this endpoint will return an HTTP response with a status code of 200 OK and a body similar to the one below.

[
    {
        "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2MTQ5Nzc3MTUsImltcCI6ZmFsc2UsImx2bCI6ImYiLCJzdWIiOiIwMUVOWDlCMUo2OE5UOVk0UUhYRDdUMFg2UyIsInR5cCI6InBhY2thZ2UiLCJ1aWQiOiIwMURYS0UxRzUwOU5CVFFYMDkwWjVITU0yMSJ9.QdGhptKjLTkzYBdhUkE03KC3CmzL6deuVdulvH_6Rtg",
        "created_at": "2020-10-30T17:37:00.998Z",
        "custom_expiry": true,
        "expiry": "2020-11-21T17:37:00.998Z",
        "extra_storage_updated_at": "2020-10-30T17:37:00.998Z",
        "extras": {},
        "id": "01ENX9B1J68NT9Y4QHXD7T0X6S",
        "links": [],
        "name": "test",
        "description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
        "progress_channels": [
        {
            "auth": {
                "auth_key": "xxxxxxxxxxxxxxxxx",
                "channel_name": "proc.upload.01CNH4WNNKZC5FWVG1V100JTXH",
                "publish_key": "pub-c-xxxxx-xxxxxxxxxxxxx",
                "subscribe_key": "sub-c-xxxxx-xxxxxxxxxxxxx"
            },
            "topic":"upload",
            "provider": "pubnub"
        }
    ],
        "sender": "[email protected]",
        "state": "new",
        "updated_at": "2020-10-30T13:37:00.999Z",
        "usage_updated_at": "2020-10-30T17:37:00.998Z"
    }
]

Where:

  • id is the package ID, which is needed to interact with the package (like downloading or deleting)
  • created_at and updated_at are the date/time at which the package was created and last updated
  • access_token is the auth token required to interact with the package (like downloading or deleting)
  • state indicates the state of the package, which can be one of the following:
    • new: indicates that the package is in transit and could still be uploading
    • finalized: the package is completed and available for download
    • expired: the package has reached it's expiry date and all of its files have been deleted
    • archived: after expiry the package can be moved to this state to separate it from other expired packages
  • progress_channels contains a list of notification channels that will receive progress updates for a given topic, such as:
    • zip: reports the progress of creating a zip file for finalized packages only
    • upload: reports the progress of the initial package upload for new packages only
  • links contains a list of download links that have been created for this package

Note

MASV integrates with PubNub for publishing and subscribing to progress messages. They provide client SDKs in several programming languages. More details can be found on their developer documentation website.

Changing the Expiry

Authorized users can update the expiry date for any package in a finalized state (subject to access policy). The expiry can be set to now to expire the package immediately or be moved to date in the future.

Attention

Extended storage charges will be incurred daily beyond the free period included with the team subscription for users who have activated their account. Trial accounts cannot extend the expiry beyond the original date given on creation - it can only be set earlier. How does Extended Storage Work?

PUT /packages/{{package_id}}/expiry

HEADERS
Name Type Required Description
X-Package-Token String Yes Package JSON Web Token
Content-Type String Yes Must be application/json
BODY
Name Type Required Description
expiry String Yes Date-time expiry for the package
REQUEST
curl -H "X-Package-Token: $PACKAGE_TOKEN" -H "Content-Type: application/json" -X POST https://api.massive.app/v1/packages/$PACKAGE_ID/expiry -d '{"expiry": "$EXPIRY"}'

Where:

  • $PACKAGE_TOKEN is the auth token returned from the package list
  • PACKAGE_ID is the identifier for the package to be updated
  • $EXPIRY is the date-time string to be used as the new expiration (ie. "2021-01-01T00:00:00.000Z")

After a successful request where the package expiry has been updated, this endpoint will return an HTTP response with a status code of 200 OK and the updated package object.

Archiving/Unarchiving Expired Packages

Authorized users can archive or unarchive any package that was previously in an expired state (subject to access policy). Archived packages can be separated from Expired packages using the filters on the package list. The Unarchive action will put the package back to an expired state.

Archive

PUT /packages/{{package_id}}/archive

Unarchive

PUT /packages/{{package_id}}/unarchive

HEADERS
Name Type Required Description
X-Package-Token String Yes Package JSON Web Token
Content-Type String Yes Must be application/json

Note

There are no BODY parameters accepted on this request.

REQUEST
curl -H "X-Package-Token: $PACKAGE_TOKEN" -H "Content-Type: application/json" -X POST https://api.massive.app/v1/packages/$PACKAGE_ID/archive

Where:

  • $PACKAGE_TOKEN is the auth token returned from the package list
  • PACKAGE_ID is the identifier for the package to be updated

After a successful request where the package has been moved to or from the archived state, this endpoint will return an HTTP response with a status code of 204 No Content.

Archiving/Unarchiving Multiple Sent Packages

Authorized users can archive or unarchive multiple packages that were previously in an expired state and sent by the team (subject to access policy). Archived packages can be separated from Expired packages using the filters on the package list. The Unarchive action will put the packages back to an expired state.

Archive

PUT /teams/{{team_id}}/packages/archive

Unarchive

PUT /teams/{{team_id}}/packages/unarchive

HEADERS
Name Type Required Description
X-User-Token String Yes User JSON Web Token
Content-Type String Yes Must be application/json
BODY
Name Type Required Description
expiry_start String Yes Earliest package expiry date-time to archive/unarchive from
expiry_end String Yes Latest package expiry date-time to archive/unarchive to
REQUEST
curl -H "X-User-Token: $USER_TOKEN" -H "Content-Type: application/json" -X POST https://api.massive.app/v1/teams/{{team_id}}/packages/archive -d '{"expiry_start": "$EXPIRY_START", "expiry_end": "$EXPIRY_END"}'

Where:

  • $USER_TOKEN is the auth token returned during auth request (refer to Authorization: Login section of this document)
  • $TEAM_ID is the team ID returned during auth request (refer to Authorization: Login section of this document)
  • $EXPIRY_START is the date-time string to be used as the lower limit on expiration date (ie. "2021-01-01T00:00:00.000Z")
  • $EXPIRY_END is the date-time string to be used as the upper limit on expiration date (ie. "2021-01-31T23:59:59.999Z")

After a successful request where the package(s) have been moved to or from the archived state, this endpoint will return an HTTP response with a status code of 200 OK and include a body similar to the one below.

{
    "total_updated":51
}

Where:

  • total_updated is the number of records that were affected.

Archiving/Unarchiving Multiple Received Packages

Authorized users can archive or unarchive multiple packages that were previously in an expired state and received through a portal (subject to access policy). Archived packages can be separated from Expired packages using the filters on the package list. The Unarchive action will put the packages back to an expired state.

Archive

PUT /teams/{{team_id}}/inbox/archive

Unarchive

PUT /teams/{{team_id}}/inbox/unarchive

HEADERS
Name Type Required Description
X-User-Token String Yes User JSON Web Token
Content-Type String Yes Must be application/json
BODY
Name Type Required Description
expiry_start String Yes Earliest package expiry date-time to archive/unarchive from
expiry_end String Yes Latest package expiry date-time to archive/unarchive to
REQUEST
curl -H "X-User-Token: $USER_TOKEN" -H "Content-Type: application/json" -X POST https://api.massive.app/v1/teams/{{team_id}}/inbox/archive -d '{"expiry_start": "$EXPIRY_START", "expiry_end": "$EXPIRY_END"}'

Where:

  • $USER_TOKEN is the auth token returned during auth request (refer to Authorization: Login section of this document)
  • $TEAM_ID is the team ID returned during auth request (refer to Authorization: Login section of this document)
  • $EXPIRY_START is the date-time string to be used as the lower limit on expiration date (ie. "2021-01-01T00:00:00.000Z")
  • $EXPIRY_END is the date-time string to be used as the upper limit on expiration date (ie. "2021-01-31T23:59:59.999Z")

After a successful request where the package(s) have been moved to or from the archived state, this endpoint will return an HTTP response with a status code of 200 OK and include a body similar to the one below.

{
    "total_updated":51
}

Where:

  • total_updated is the number of records that were affected.