Update Video

Update Video Data

This endpoint will upate some fields of video. The fields are Title, Description, Options and Tags. You will need to POST the full "options" object that you receive in your video GET request. Please don't omit any fields.

PUT https://api.dyntube.com/v1/videos/{id}

Request Body

NameTypeDescription

title*

String

Video Title

description*

String

Video Description

tags*

Array

Video Tags

options*

Object

Options object provided in GET video request.

{
    "id": "fFL56RU6PjvJPeE",
    "duration": "00:02:30.1270000",
    "projectId": "unjVhFJ7vAhrYu9",
    "accountKey": "6aG9UBe5rGPzjbh",
    "region": "use-s",
    "captions": [],
    "key": "NULPJ7mWDuyj4w5",
    "channelKey": "f8RMr2q4h6yNpv9",
    "privateLink": "QBr6n8HN878t5sH",
    "hlsLink": "Sx5FTtWsUU8tmux",
    "planType": 1,
    "mp4Url": "",
    "mp4Urls": [],
    "formats": {
        "hls": true,
        "mp4": false
    },
    "hlsUrl": "https://api.dyntube.com/v1/apps/hls/FhyinduNY4Kr9Q.m3u8",
    "hlsUrlWeb": "https://api.dyntube.com/v1/live/videos/EruJdgOPsbUg.m3u8",
    "title": "My Video",
    "description": "",
    "options": {
        "autoplay": false,
        "playerColor": "rgba(255, 65, 113, 0.83)",
        "playerSkin": "solid",
        "controlsColor": "#FFFFFF",
        "seekButtons": false,
        "volumeControl": true,
        "preload": "auto",
        "fullscreenControl": true,
        "controls": true,
        "stickyControls": false,
        "defaultQuality": "",
        "qualityControl": true,
        "speedControl": true,
        "fastForward": true,
        "bigPlayControl": true,
        "playControl": true,
        "volume": 1.0,
        "loop": false,
        "muted": false,
        "modal": false
    },
    "tags": [],
    "version": 1,
    "status": 3,
    "created": "2016-08-27T12:37:24.4970796+00:00"
}

Here is a sample request

{
            "id": "VT3qwXmpxIVA",
            "title": "Video",
            "description": "",
            "options": {
                "autoplay": false,
                "playerColor": "rgba(255, 65, 113, 0.83)",
                "playerSkin": "solid",
                "controlsColor": "#FFFFFF",
                "seekButtons": false,
                "volumeControl": true,
                "preload": "auto",
                "fullscreenControl": true,
                "controls": true,
                "stickyControls": false,
                "defaultQuality": "",
                "qualityControl": true,
                "speedControl": true,
                "fastForward": true,
                "bigPlayControl": true,
                "playControl": true,
                "volume": 1.0,
                "loop": false,
                "muted": false,
                "linkSharing": true,
                "modal": false,
                "resumePlayback": false
            },
            "tags": [],
        }

Sample C# request

using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;

//Note: You will need to add the Newtonsoft.Json package from NuGet to use the `JsonConvert.SerializeObject` method.


namespace HttpPutRequestExample
{
    class Program
    {
        static async System.Threading.Tasks.Task Main(string[] args)
        {
            string id = "VT3qwXmpxIVA";
            string url = "https://api.dyntube.com/v1/videos/" + id;

            var data = new
            {
                id = "VT3qwXmpxIVA",
                title = "Video",
                description = "",
                options = new
                {
                    autoplay = false,
                    playerColor = "rgba(255, 65, 113, 0.83)",
                    playerSkin = "solid",
                    controlsColor = "#FFFFFF",
                    seekButtons = false,
                    volumeControl = true,
                    preload = "auto",
                    fullscreenControl = true,
                    controls = true,
                    stickyControls = false,
                    defaultQuality = "",
                    qualityControl = true,
                    speedControl = true,
                    fastForward = true,
                    bigPlayControl = true,
                    playControl = true,
                    volume = 1.0,
                    loop = false,
                    muted = false,
                    linkSharing = true,
                    modal = false,
                    resumePlayback = false
                },
                tags = new string[] { }
            };

            using (var httpClient = new HttpClient())
            {
                var content = new StringContent(Newtonsoft.Json.JsonConvert.SerializeObject(data), Encoding.UTF8, "application/json");
                var response = await httpClient.PutAsync(url, content);

                if (response.IsSuccessStatusCode)
                {
                    Console.WriteLine("Successful PUT request");
                }
                else
                {
                    Console.WriteLine("PUT request failed with status code: " + response.StatusCode);
                }
            }
        }
    }

Sample Node.js

const https = require('https');
const data = JSON.stringify({
            "id": "VT3qwXmpxIVA",
            "title": "Video",
            "description": "",
            "options": {
                "autoplay": false,
                "playerColor": "rgba(255, 65, 113, 0.83)",
                "playerSkin": "solid",
                "controlsColor": "#FFFFFF",
                "seekButtons": false,
                "volumeControl": true,
                "preload": "auto",
                "fullscreenControl": true,
                "controls": true,
                "stickyControls": false,
                "defaultQuality": "",
                "qualityControl": true,
                "speedControl": true,
                "fastForward": true,
                "bigPlayControl": true,
                "playControl": true,
                "volume": 1.0,
                "loop": false,
                "muted": false,
                "linkSharing": true,
                "modal": false,
                "resumePlayback": false
            },
            "tags": [],
        });

const options = {
  hostname: 'api.dyntube.com',
  port: 443,
  path: '/v1/videos/VT3qwXmpxIVA',
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
    'Content-Length': data.length
  }
};

const req = https.request(options, (res) => {
  console.log(`statusCode: ${res.statusCode}`);

  res.on('data', (d) => {
    process.stdout.write(d);
  });
});

req.on('error', (error) => {
  console.error(error);
});

req.write(data);
req.end();

Python

import json
import requests

id = "VT3qwXmpxIVA"
url = f"https://api.dyntube.com/v1/videos/{id}"

data = {
    "id": id,
    "title": "Video",
    "description": "",
    "options": {
        "autoplay": False,
        "playerColor": "rgba(255, 65, 113, 0.83)",
        "playerSkin": "solid",
        "controlsColor": "#FFFFFF",
        "seekButtons": False,
        "volumeControl": True,
        "preload": "auto",
        "fullscreenControl": True,
        "controls": True,
        "stickyControls": False,
        "defaultQuality": "",
        "qualityControl": True,
        "speedControl": True,
        "fastForward": True,
        "bigPlayControl": True,
        "playControl": True,
        "volume": 1.0,
        "loop": False,
        "muted": False,
        "linkSharing": True,
        "modal": False,
        "resumePlayback": False
    },
    "tags": []
}

headers = {"Content-type": "application/json"}
response = requests.put(url, data=json.dumps(data), headers=headers)

if response.status_code == 200:
    print("Successful PUT request")
else:
    print(f"PUT request failed with status code: {response.status_code}")

PHP

<?php

$id = "VT3qwXmpxIVA";
$url = "https://api.dyntube.com/v1/videos/" . $id;

$data = array(
    "id" => $id,
    "title" => "Video",
    "description" => "",
    "options" => array(
        "autoplay" => false,
        "playerColor" => "rgba(255, 65, 113, 0.83)",
        "playerSkin" => "solid",
        "controlsColor" => "#FFFFFF",
        "seekButtons" => false,
        "volumeControl" => true,
        "preload" => "auto",
        "fullscreenControl" => true,
        "controls" => true,
        "stickyControls" => false,
        "defaultQuality" => "",
        "qualityControl" => true,
        "speedControl" => true,
        "fastForward" => true,
        "bigPlayControl" => true,
        "playControl" => true,
        "volume" => 1.0,
        "loop" => false,
        "muted" => false,
        "linkSharing" => true,
        "modal" => false,
        "resumePlayback" => false
    ),
    "tags" => array()
);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

if ($response === false) {
    echo "PUT request failed: " . curl_error($ch);
} else {
    $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($httpStatus == 200) {
        echo "Successful PUT request";
    } else {
        echo "PUT request failed with status code: " . $httpStatus;
    }
}

curl_close($ch);

Last updated