This endpoint creates AWS signed URLs for video upload to the platform. It also supports FineUploader specific routes which allows the platform to check if a video has been successfully uploaded to S3. This endpoint is currently limited for internal use.

Collection /upload

POST /upload/signature

Returns a signature and associated policy that can be used to upload a video to the video ingest S3 bucket. Expects JSON object for request data.

The inputs and method to create the signature are documented by Amazon here:
Browser-Based Upload using HTTP POST (Using AWS Signature Version 4)

  • expiration - the time at which the signature should expire and no longer
    allow upload
  • conditions - an array containing keys such as acl, bucket,
    ContentType, success_action_status, key, x-amz-meta-qqfilename and
    content-length-range which are documented fully in the AWS documentation.

item value
Access user | system
Full url https://api.buto.tv/v2/upload/signature
verb POST
params string:expiration array:conditions

Example usage

curl -X POST -H "Content-Type: application/json" -d \
'{
    "expiration": "2016-05-15T14:05:56.210Z",
    "conditions": [
        {"acl": "private"},
        {"bucket": "buto-uploads"},
        {"Content-Type": "video/mp4"},
        {"success_action_status": "200"},
        {"key": "<s3 filename>.mp4"},
        {"x-amz-meta-qqfilename": "<actual filename>.mp4"},
        ["content-length-range", "0", "5000000000"]
    ]
}' \
https://api.buto.tv/v2/upload/signature

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "policy": "<base64 encoded policy string>",
    "signature": "<base64 encoded AWS v4 signature>"
}

POST /upload/success?success

Handles a FineUploader callback when it finishes a video upload. Checks that the upload was successful and feeds this information back to FineUploader. Expects request data to be form encoded and empty success query string parameter is required.

This route is not intended to be called manually and is designed to work specifically with FineUploader implementations.

FineUploader defines a success callback, described here:
FineUploader Documentation for success callback

This endpoint also handles presentation uploads for SlideSync through the application query parameter. When this parameter equals presenter_buto_tv_upload_form a new Presentation object is created and the ID is returned. The platform triggers internal QueueJob processing for the presentation file.

Append slide operations are supported through an additional append parameter which, when present with a form parameter of presentation_id, appends slides to the existing presentation.

  • isBrowserPreviewCapable - refers to browser image preview support
  • key - the S3 filename, referred to as the item key
  • uuid - the unique identifier on S3 (often the key without the file
    extension)
  • name - the real filename
  • bucket - the name of the S3 bucket
  • etag - AWS entity tag (another identifier)

item value
Access user | system
Full url https://api.buto.tv/v2/upload/success?success
verb POST
params boolean:isBrowserPreviewCapable string:key string:uuid string:name string:bucket string:etag
param string:application optional query param, can equal presenter_buto_tv
param string:append optional query param, just needs to be present to trigger append
param string:presentation_id form param, required when append is set

Example usage

curl -X POST \
-F 'isBrowserPreviewCapable=true' \
-F 'key=<s3 key>.mp4' \
-F 'uuid=<s3 uuid>' \
-F 'name=<filename>' \
-F 'bucket=buto-uploads' \
-F 'etag=<s3 etag>' \
https://api.buto.tv/v2/upload/success?success

returns

HTTP/1.1 200 OK
...
Content-Type: application/json

{
    "tempLink": "<signed URL link to the uploaded file>",
    "thumbnailUrl": "<signed URL link to a thumbnail>"
}

GET /upload/iframe

Generates empty HTML page to enable FineUploader to support older browsers as described here:
FineUploader documentation