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": "2022-11-21T17:37:00.998Z",
"extra_storage_updated_at": "2020-10-30T17:37:00.998Z",
"extra_storage_days": 3,
"extras": {},
"id": "01ENX9B1J68NT9Y4QHXD7T0X6S",
"links": [{
"access_limit": 3,
"access_limit_enabled": true,
"accessed_at": "0001-01-01T00:00:00.000Z",
"active": false,
"created_at": "2022-04-25T15:03:01.666Z",
"email": "example@masv.io",
"expiry": "2022-05-05T15:03:01.608Z",
"id": "01G1GKYMS2941W6EFC7K9DEYBP",
"recipient_notified": "pending",
"unlimited_storage": false,
"usage_updated_at": "2022-04-25T15:03:01.666Z"
}],
"name": "test",
"description": "Lorem ipsum dolor sit amet, consectetur adipiscing elit",
"contains_virus": true,
"tag": {
"id": "01ENX9B1JBH8A9Y4QHXD7T0X6S",
"name": "example tag name"
},
"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": "test2@test2.com",
"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 |
contains_virus |
Built in virus protection will detect if packages contains a virus. |
progress_channels |
PubNub progress events. |
tag |
An object with the package's tag name and ID. This field is only included if the package has a tag, otherwise it is excluded from the response. |
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. |
extra_storage_days |
Number of days of extra storage that have been set on the 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. Setting the expiry date to 0001-01-01T00:00:00.000Z
will activate unlimited storage for a package.
Attention
For Unlimited and 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.
Changing the Name
Authorized users can update the name for any package in a new
or finalized
state that they are authorized to view. (access policy).
Method | Route |
---|---|
PUT |
/packages/{{ package_id }} |
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 |
---|---|---|---|
name |
String | Yes | Name for the package |
REQUEST PARAMETERS
Name | Type | Required | Description |
---|---|---|---|
package_id |
String | Yes | Package ID for which to grab data from. |
REQUEST
curl -d "{\"name\": \"$NAME\"}" \
-H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X POST https://api.massive.app/v1/packages/$PACKAGE_ID
After a successful request where the package name 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. |