Uploading Content from Your Cloud Storage
Creating a New File in MediaSilo
Uploading your content from your cloud to MediaSilo is simple. You just provide MediaSilo with the URL of your file, and MediaSilo will take care of the rest.
Calling the Asset Create endpoint will create a new file in MediaSilo from the given URL. Here's an example:
curl --request POST \
--url https://api.shift.io/v3/assets \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-key: YOUR_API_KEY' \
--header 'x-secret: YOUR_API_SECRET'
--data '{
"sourceUrl": "URL_TO_YOUR_ASSET",
"projectId": "0XXXCC-014B-2XX0-CF518DXXXX393E"
}'
Project ID
Notice the above request has a project ID. All of your media in MediaSilo is organized into projects. In order to create a new file in MediaSilo, you need to pass in the ID of the project in which you want to create the new file. Use the Projects endpoint to retrieve the projects you have access to.
Check Asset Encoding Progress
Before using the newly added asset in MediaSilo, you will need to make sure the encoding process has completed. You can do this by calling Get Asset Encoding Progress. When the progress equals 100, that means your file is ready to be used.
curl --request POST \
--url https://api.shift.io/v3/assets/assetUuid/encode/progress \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'x-key: YOUR_API_KEY' \
--header 'x-secret: YOUR_API_SECRET'
That's it! You've just created a new asset in MediaSilo.
Troubleshooting
Your media may be stored securely with your cloud provider in a way that makes public access forbidden, in which case MediaSilo won't be able to access your files. If this is the case for you, be sure to sign the URL with your cloud provider before giving the URL to MediaSilo. Otherwise, it's likely that MediaSilo won't be able to access the file.
How do I securely provide an asset URL to MediaSilo?
By HMAC-signing the URLs that you provide to the MediaSilo API, you're allowing MediaSilo to temporarily access a file in your cloud while preventing public access to it. AWS, Google Cloud, and Azure all have support for URL signing.
AWS HMAC Signing
https://docs.aws.amazon.com/AmazonS3/latest/dev/ShareObjectPreSignedURL.html
Google Cloud HMAC Signing
https://cloud.google.com/storage/docs/access-control/signed-urls
Azure HMAC Signing
https://docs.microsoft.com/en-us/azure/storage/common/storage-sas-overview
Uploading without HMAC
You don't need to sign your URLs beforehand. MediaSilo will still ingest your files from public URLs. However, we strongly recommend that you secure your content and only provide temporary access to MediaSilo via HMAC-signed URLs.
Updated over 2 years ago