Uploading Content From Your Cloud Storage

Creating A New File in SHIFT

Uploading your content from your cloud to SHIFT is simple. You just provide SHIFT with the URL of your file and SHIFT will take care of the rest.

Calling the Asset Create endpoint will create a new file in SHIFT 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 that above request has a project ID. All of your media in SHIFT is organized into projects. In order to create a new file in SHIFT 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.

That's it! You've just created a new asset in SHIFT.

🚧

Troubleshooting

Your media may be stored securely with your cloud provider in a way that makes public access forbidden. In which case SHIFT 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 SHIFT. Otherwise, it's likely that SHIFT won't be able to access the file.

How do I securely provide an asset URL to SHIFT?

By HMAC signing the URL's that you provide to the SHIFT API, you're allowing SHIFT 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 URL's beforehand. SHIFT will still ingest your files from public URLs. However, we strongly recommend that you secure your content and only provide temporary access to SHIFT via HMAC signed URLs.


Did this page help you?