Videos
Update Video
Use this endpoint to update a video's title, description, player options, and tags. Send the full options object from the video GET response so existing player settings are preserved.
PUT https://api.dyntube.com/v1/videos/{id}
Headers
| Name | Type | Description |
|---|---|---|
| Authorization | String | Bearer YOUR_API_KEY |
Request Body
| Name | Type | Description |
|---|---|---|
| title* | String | Video Title |
| description* | String | Video Description |
| tags* | Array | Video Tags |
| options* | Object | Options object provided in GET video request. |
200: OK
json
{
"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/apps/hls/FhyinduNY4Kr9Q.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,
"statusName": "Published",
"created": "2016-08-27T12:37:24.4970796+00:00"
}Here is a sample request
json
{
"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
csharp
using System;
using System.Net.Http;
using System.Text;
using Newtonsoft.Json;
using System.Net.Http.Headers;
//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;
string bearerToken = "your_bearer_token";
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())
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);
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
javascript
import axios from 'axios';
const data = {
"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": []
};
await axios.put('https://api.dyntube.com/v1/videos/VT3qwXmpxIVA', data, {
headers: {
Authorization: 'Bearer your_bearer_token'
}
}).then(res => console.log('Updated', res.status));Python
python
import json
import requests
id = "VT3qwXmpxIVA"
url = f"https://api.dyntube.com/v1/videos/{id}"
bearer = "your_bearer_token"
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",
"Authorization": f"Bearer {bearer}"
}
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;
$bearer = "your_bearer_token";
$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',
'Authorization: Bearer ' . $bearer
));
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);Related Pages
- Get video to fetch the full options object before updating.
- Update video image to replace the thumbnail.
- Move videos between projects if the video belongs in another project.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.