Skip to content

Package Management

The MASV API allows authorized users to manage packages that have been sent and received under their account.

Info

Packages tied to 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 sent by a team that they belong to that they are authorized to view. (access policy).

Method Route
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 Boolean No If expired packages should be included in response
Default Value: true
finalized Boolean No If finalized packages should be included in response
Default Value: true
new Boolean No If new packages should be included in response
Default Value: false
archived Boolean No If archived packages should be included in response
Default Value: false

Note

The query parameters are optional and allow for filtering of the package list to match certain states.

URL Parameters
Name Type Required Description
team_id String Yes The team id returned during auth request
REQUEST
curl -H "X-User-Token: $USER_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/packages

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

[
    {
        "access_token": "xxxxxxxxxxxxxxxxx",
        "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"
    }
]

Response Properties:

Property Description
team_id The team id that the package is bound to.
created_at Time that the object was created at
updated_at Last time the package was updated.
access_token Auth token required to interact with the package.
state Indicates the state of the package
Possible Values: new, finalized, expired, archived
progress_channels PubNub progress events.
progress_channels.zip Reports the progress of zip file creation for finalized packages.
progress_channels.upload Reports the progress of initial package upload for new packages only.
links List of download links 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 that they are authorized to view. (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?

Method Route
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
Default: 0001-01-01T00:00:00.000Z
Accepted Format: ISO 8601
REQUEST PARAMETERS
Name Type Required Description
package_id String Yes Package ID for which to grab data from.
REQUEST
curl -d "{\"expiry\": \"$EXPIRY\"}" \
-H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/packages/$PACKAGE_ID/expiry

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 (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 / Unarchive
Method Route
PUT /packages/{{package_id}}/archive
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
REQUEST PARAMETERS
Name Type Required Description
package_id String Yes Package ID for which to grab data from.

Warning

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
curl -H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/packages/$PACKAGE_ID/unarchive

After a successful request where the package has been archived or unarchived, this endpoint will then return an HTTP response with a status code of 204 No Content and an empty body.

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 / Unarchive
Method Route
PUT /teams/{{package_id}}/archive
PUT /teams/{{package_id}}/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.
Default: 0001-01-01T00:00:00.000Z
Accepted Format: ISO 8601
expiry_end String Yes Latest package expiry date-time to archive/unarchive to.
Default: 0001-01-01T00:00:00.000Z
Accepted Format: ISO 8601
URL Parameters
Name Type Required Description
team_id String Yes The team id that the package is bound to.
REQUEST
curl -d '{"expiry_start": "$EXPIRY_START", "expiry_end": "$EXPIRY_END"}' \
-H "X-User-Token: $USER_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/packages/archive 

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
}

Response Properties:

Property Description
total_updated Number of records that were effected.

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 / Unarchive
Method Route
PUT /teams/{{package_id}}/inbox/archive
PUT /teams/{{package_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
URL Parameters
Name Type Required Description
team_id String In /teams route The team id that the package is bound to.
REQUEST
curl -d "{\"expiry_start\": \"$EXPIRY_START\", \"expiry_end\": \"$EXPIRY_END\"}" \
-H "X-User-Token: $USER_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/teams/$TEAM_ID/inbox/archive 

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
}

Response Properties:

Property Description
total_updated Number of records that were effected.