Media Shuttle’s System-to-Person API allows you to generate single use links that allow specified users to upload or download content using a Media Shuttle portal. Signiant Jet, Signiant Flight Deck, media asset managers (MAMs), digital asset managers (DAMs), or other third-party applications can integrate with Media Shuttle using the System-to-Person API.
Before you begin integrating the System-to-Person API, make sure you have these requirements in place:
For more information, see Getting Started with Media Shuttle API.
In order to use the System-to-Person API, it is important to understand the overall relationship between Media Shuttle concepts and terminology.
Actor - The person or application using the API to generate an upload or download link. An actor is granted permission to generate a link via the access control layer which is controlled by the specific portal used in the transfer.
Access Control - Portal-level permissions that are based on roles or links associated with a portal providing access to stored content, control over storage access, and overall control over the account.
Account - The overall organization associated with all portals. Each account is associated with API keys that provide access to the API.
Portal - A URL associated with an account that provides access to storage via access control. A single account can be associated with many portals.
Storage - An on-premises or cloud-based location that contains files or objects used in transfers, such as file storage, Amazon S3, or Microsoft Azure.
Transfer - The upload or download action associated with a link. Once a transfer happens, the link is redeemed and can no longer be used.
Package - A unique identifier that refers to a grouping of files or a placeholder where files can be uploaded.
Download packages contain downloadable content from storage.
Upload packages act as a placeholder to allow the user to add content to storage.
A package can be reused across multiple transfers
The System-to-Person API has a maximum payload size of 100 kB, and can transfer a maximum of 100 files per package.
Integrated Media Shuttle download or upload workflows require a series of REST calls to create upload and download links that can be used to send or receive files. In addition to providing access to storage, the API allows queries for portal transfer events and send webhooks when transfers complete, fail, or are cancelled by a user.
The following diagram shows the required commands and their sequence for a typical integration workflow:
When generating an upload or download link, you must provide the recipient’s email address to ensure that only the recipient can send or receive content.
Once a link is generated, the recipient will be added to the associated portal as a Portal Member without direct access to the Media Shuttle portal, to ensure System-to-Person transactions provide reporting data and portal security.
Media Shuttle can be used to acquire content for file ingestion workflows:
Media Shuttle can be used to distribute content for fulfillment workflows:
API events can also send webhooks, or callbacks, to a URL when transferring files using the system-to-person API.
To set a webhook URL, create a notification
array and include the webhook url in a token request body:
{
"user": {
"email": "user@example.com"
},
"grants": ["download"],
"expiresOn": "2019-01-21T11:00:45.046Z",
"notifications": [
{
"type": "webhook",
"url": "http://example.com/path/to/webhook"
}
]
}
For more information on using webhooks, see Working With Webhooks.
You can use the Media Shuttle API to retrieve metadata form information submitted in Submit portals.
To retrieve metadata:
GET /portals
.url
field with the relevant Submit portal URL.POST /portals/{portalId}/subscriptions
.portalId
field with the copied portal ID.GET /portals/{portalId}/packages/{packageId}
.portalId
and packageId
fields.A successful response will return the submitted metadata in the Response body.
For more information on using webhooks, see Working with Webhooks.
Download links in a distribution workflow are single use by default. To allow for multiple use, set the isReusable
to true
in a request body:
{
"user": {
"email": "user@example.com"
},
"grants": ["download"],
"expiresOn": "2019-01-21T11:00:45.046Z",
"isReusable": true
}
Note: Upload links can only be used once.
You can use the System-to-Person Automation API to create a workflow without writing any code. Media Shuttle uses SwaggerUI Documentation to provide a functional API reference that can be used with your account to create upload or download tokens for acquisition or distribution workflows.
Note: Tokens are single use, and a separate token is required for each recipient.
To authorize your account:
Note: The SwaggerUI authorization is handled by SwaggerHub. This does not provide SwaggerHub with access to your content.
To distribute or receive content, you must create a package.
To create a package:
GET /portals
to obtain the portal ID for the portal.id
for the relevant portal to your clipboard.POST /portals/{portalId}/packages
.id
in the portalId
field.A successful response includes a package id
and the portalId
, which can be used to generate tokens to distribute or acquire content.
Token generation differs depending on the type of workflow being used.
Distribution workflows allow users to download content from portals using a link. A distribution workflow, uses the PUT /portals/{portalId}/packages/{packageId}/files
API endpoint to accept request body data.
Note: When using a Send portal, the files must be added to a folder that uses the same name as the packageId
.
To create a distribution of files or folders:
PUT /portals/{portalId}/packages/{packageId}/files
.portalId
and packageId
fields.path
parameter to a file or folder in the portal.isDirectory
parameter as needed.A successful response includes a matching JSON array of file objects containing the files or folders to be downloaded.
Note: A package can only be assigned one set of files. Additional calls to the /files
API endpoint for the same package will be rejected.
Once files have been added to the packageId
folder, generate a download token using POST /portals/{portalId}/packages/{packageId}/tokens
API endpoint, and setting a download
grant for a portal member. The token is a URL that allows a user to download the packaged files or folders.
To create a download token:
PUT /portals/{portalId}/packages/{packageId}/tokens
.portalId
and packageId
fields.Test the download URL workflow by copying the url
value from the response body into a browser and using it to download files from the portal. Create tokens as necessary by repeating the call to the API endpoint.
For an acquisition workflow, the token url
is used in a browser to allow portal members to upload files to a portal by setting an upload
grant in the request body. The /portals/{portalId}/packages/{packageId}/tokens
API endpoint supports a destinationPath
which specifies an upload folder relative to the portal’s storage root.
You can determine the portal’s root in the IT Administration Console by checking the path setting on the portal’s Storage settings.
Submit portals with deliveries organized into unique folders determine transfer destinations automatically and do not support the destinationPath
parameter.
To create an upload token:
PUT /portals/{portalId}/packages/{packageId}/tokens
.portalId
and packageId
fields.Test the upload URL by copying the URL from the response body into a browser.
Note: No notification is sent to the provided email address when a token is created and must be provided to the recipient. The email address used to redeem the token is used for auditing purposes, and is recorded in the portal’s transfer history.
You can query the activities associated with a package using GET /portals/{portalId}/packages/{packageId}/events
. The response from the query will allow you to build an audit trail of activity or create proof of delivery as required.
A transfer error can occur within a distribution workflow when an incorrect path is specified. This error can also occur when content is deleted from the storage location, or the file path includes invalid characters.
To prevent this error, ensure that the content specified in the package remains in the storage location until the download token is redeemed, and that the file name does not contain any of the following characters: \ / [ : ? * < > "|