Links
The MASV API allows authorized users to manage download links for their Packages. All requests require authentication using a Package token authorized to manage the Package. This can be retrieved from the access_token
property in the Package response.
Creating Links
Authorized users can create additional direct-download links or send a link to a specific email recipient after the upload has been finalized. To create a link the package must be in the "new" or "finalized" state. Links that are created while the upload is in progress will remain inactive until the package is finalized.
POST /packages/{package_id}/links
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 |
---|---|---|---|
email |
String | No | Recipient email address or empty for direct-download link |
password |
String | No | Password that user must enter before being able to view and download the package files |
REQUEST
curl -d "{\"email\":\"$EMAIL\", \"password\":\"$PASSWORD\"}" \
-H "X-Package-Token: PACKAGE_TOKEN" -H \
"Content-Type: application/json" \
-s -X POST https://api.massive.app/v1/packages/PACKAGE_ID/links
After a successful request where a link has been added to the package, this endpoint will return an HTTP response with a status code of 201 Created
and a body similar to the one below.
{
"access_limit": 5,
"access_limit_enabled": true,
"active": true,
"download_secret": "bqkBtnPwvmkgJpHN",
"email": "[email protected]",
"expiry": "2020-12-04T13:14:01.038Z",
"id": "01EKX32ZSAPSCFC97W5Z423QKY",
"password": "****",
}
Response Properties:
Property | Description |
---|---|
access_limit |
Number of times that a download can be initiated using this link before it becomes locked. |
access_limit_enabled |
Is there an access_limit enforced. |
active |
Can the link be used to download the package. |
id |
Unique identifier for the link record. |
download_secret |
A key provided with id to request a token to download the file. |
email |
Recipients email. (If not provided defaults to uploader email.) |
password |
Indicates if a password is attached to the link. If present and value == "****" that means a password is required. Length of the response is constant and does not expose the length of the actual password. |
Note
Take note of the id
and download_secret
as they are required to access the download page. The download_secret
is only returned in this response if the email
is empty and cannot be retrieved via the API again.
Once the link has been created an email will be sent to the recipient automatically (if provided) and it can be used to access the package on MASV via the following URL: https://get.massive.app/{link_id}?secret={download_secret}
Where:
link_id
is the link identifier returned when creating the link abovedownload_secret
is the secret key returned when creating the link above
Note
The request will need to be repeated for each additional email recipient or direct-download link you wish to create. Only one recipient per link may be specified.
List Package Links
Authorized users can retrieve a list of all links that belong to a package.
Method | Route |
---|---|
GET |
/packages/{{ package_id }}/links |
HEADERS
Name | Type | Required | Description |
---|---|---|---|
X-Package-Token |
String | Yes | Package JSON Web Token |
Content-Type |
String | Yes | Must be application/json |
URL Parameters
Name | Type | Required | Description |
---|---|---|---|
package_id |
String | Yes | The package id returned during create package request |
REQUEST
curl -H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X GET https://api.massive.app/v1/packages/{{ package_id }}/links
This endpoint will return an HTTP response with a status code of 200 OK
and a body similar to the one below.
[
{
"access_limit": 5,
"access_limit_enabled": true,
"active": true,
"email": "[email protected]",
"expiry": "2020-12-04T13:14:01.038Z",
"id": "01EKX32ZSAPSCFC97W5Z423QKY",
"password": "****",
}
]
Response Properties:
Property | Description |
---|---|
access_limit |
Number of times that a download can be initiated using this link before it becomes locked. |
access_limit_enabled |
Is there an access_limit enforced. |
active |
Can the link be used to download the package. |
id |
Unique identifier for the link record. |
email |
Recipients email. (If not provided defaults to uploader email.) |
password |
Indicates if a password is attached to the link. If present and value == "****" that means a password is required. Length of the response is constant and does not expose the length of the actual password. |
Disable a Link
Authorized users can disable a download link to prevent new downloads and remove access to package details from the download page. The link record will remain for historical purposes.
Method | Route |
---|---|
DELETE |
/packages/{{ package_id }}/links/{{ link_id }} |
HEADERS
Name | Type | Required | Description |
---|---|---|---|
X-Package-Token |
String | Yes | Package JSON Web Token |
Content-Type |
String | Yes | Must be application/json |
URL Parameters
Name | Type | Required | Description |
---|---|---|---|
package_id |
String | Yes | The package id returned during create package request |
link_id |
String | Yes | The link id returned during create link request |
REQUEST
curl -H "X-Package-Token: $PACKAGE_TOKEN" \
-H "Content-Type: application/json" \
-X DELETE https://api.massive.app/v1/packages/{{ package_id }}/links/{{ link__id }}
This endpoint will return an HTTP response with a status code of 204 No Content
and an empty body. Any downloads that are in progress at the time of deletion may complete normally, however, the download page will become inaccessible and new downloads cannot be started.