How can I upload a video on the Gumlet Dashboard using API?

Hey community!

I’m currently exploring Gumlet and find it to be a compelling tool for video optimization. Could someone from your team please clarify whether there is an API available for direct uploads on Gumlet, or if the Dashboard is the sole option for this functionality?

1 Like

Hey Sahil! Yes, you can upload a video directly using API. Follow the given instructions below to do this task:

  1. Create a verified Gumlet URL
    Create a new Direct Upload Asset with personalized Asset Parameters to start the process. After that, the Gumlet API will give you an authenticated URL that you can use right away along with a distinct asset ID linked to that Direct Upload Asset. With the help of this asset ID, you can thereafter check on its status using the Gumlet Video Manager or the API.
    For example,

curl -L -X POST ‘https://api.gumlet.com/v1/video/assets/upload
-H ‘Authorization: Bearer <YOUR_API_KEY>’
-H ‘Content-Type: application/json’
-d ‘{
“source_id”: ,
“format”: “hls”,
“resolution”: [“240p”, “360p”, “720p”, “1080p”],
“image_overlay”: {
“url”: “https://assets.gumlet.io/assets/logo.svg?format=png”,
“height”: “10%”,
“width”: “10%”,
“horizontal_align”: “left”,
“horizontal_margin”: “5%”,
“vertical_align”: “top”,
“vertical_margin”: “5%”
}
}’

Response:

{
    "asset_id": "60c1b50a6676496c4bd9bec7",
    "progress": 0,
    "created_at": 1623307530439,
    "status": "upload-pending",
    "input": {
        "transformations": {
            "format": "hls",
            "resolution": [
                "240p",
                "360p",
                "720p",
                "1080p"
            ],
            "video_codec": [
                "libx264"
            ],
            "audio_codec": [
                "aac"
            ],
            "image_overlay": {
                "url": "https://assets.gumlet.io/assets/logo.svg?format=png",
                "vertical_align": "top",
                "horizontal_align": "left",
                "vertical_margin": "5%",
                "horizontal_margin": "5%",
                "width": "10%",
                "height": "10%"
            },
            "thumbnail": [
                "auto"
            ],
            "thumbnail_format": "png",
            "mp4_access": false,
            "per_title_encoding": true,
            "process_low_resolution_input": false,
            "keep_original": true
        },
        "source_url": "60c1af0c667649f5a0d9ada2/60c1b50a6676496c4bd9bec7/origin-60c1b50a6676496c4bd9bec7"
    },
    "output": {
        "format": "hls",
        "status_url": "https://api.gumlet.com/v1/video/assets/60c1b50a6676496c4bd9bec7",
        "playback_url": "https://video.gumlet.io/60c1af0c667649f5a0d9ada2/60c1b50a6676496c4bd9bec7/1.m3u8",
        "thumbnail_url": [
            "https://video.gumlet.io/60c1af0c667649f5a0d9ada2/60c1b50a6676496c4bd9bec7/thumbnail-1-0.png"
        ]
    },
    "upload_url": "https://gumlet-video-user-uploads.s3.us-west-2.amazonaws.com/gumlet-user-uploads-prod/60c1af0c667649f5a0d9ada2/60c1b50a6676496c4bd9bec7/origin-60c1b50a6676496c4bd9bec7?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIA4WNLTXWDOHE3WKEQ%2F20210610%2Fus-west-2%2Fs3%2Faws4_request&X-Amz-Date=20210610T064530Z&X-Amz-Expires=3600&X-Amz-Signature=677006b4486468416c1af44dbb1a4482aaf50a714d1525745a2ff68f567d3164&X-Amz-SignedHeaders=host"
}
  1. To upload a file, use the URL
    After obtaining the upload_url as shown in the response example above, utilize the secured URL to submit a PUT request with the file included in the body as shown below.
    curl -v -X PUT -T video.mp4 <upload_url> You will get the code snippet for Python, JavaScript, and PHP from there.
    Following the successful execution of the cURL command, new Assets with the configurations you provided in the initial step to create a Direct Upload Asset ought to appear in the Gumlet Video Manager.

  2. See the uploaded video
    The Video Asset Status API allows you to access the video that you have uploaded. The original_download_url field, which contains the URL to the submitted movie, will be sent to you as part of the API response.
    Gumlet will store your original videos in its storage space by default. You can set the keep_original parameter to false in the Create Asset API to prevent Gumlet from storing your original video after it has been processed. Gumlet will subsequently remove the original video.

This is how you can upload a video using API. Do let me know if you have further queries on this.

Thank you