Video Upload via URL (server side)

This page provides instructions for uploading videos to DynTube using URLs via the API.

API URL

Please note that the API URL for video uploads is upload.dyntube.com and not api.dyntube.com.

Upload Video via URL

If you have a remote URL of a file, you can provide the URL to upload your video to DynTube.

  • The process is the same as uploading a normal file but instead of providing a file input, you can provide a field named url

  • An HTML Form should be posted to the following endpoint.

  • The Content-Type should be multipart/form-data.

  • You can optionally provide other fields, such as projectId and planType and videoId.

Replace an Existing Video

Please have a look at the optional parameters of the above two upload methods. You just need to add a parameter videoId in your upload API call to replace an existing video.

API Request

POST https://upload.dyntube.com/v1/videos

Request Body

NameTypeDescription

projectId

String

Project Id

planType

Integer

title

String

Video Title

videoId

String

To replace an existing video

description

String

Video description

tags

String

Video tags, add multiple tags by adding the 'tags' field multiple times in your POST request with different values.

Response

{
    "videoKey": "hgor6PnFQ",
    "uploadId": "3060c035-95ec-76495564",
    "videoId": "DTQ5It1KwNg",
    "channelKey": "u3u0iNPlL1Bg",
    "privateLink": "pheF3ukFQQ",
    "iframeLink": "klGiWrxW0nPzxw"
}

Node.js Code Example Using a URL to upload video

import fetch from 'node-fetch';
import { FormData } from 'formdata-node';

const uploadVideo = async () => {
    const form = new FormData();
    form.append('url', 'https://domain.com/video.mp4');

    const options = {
        method: 'POST',
        headers: {
            'Authorization': 'Bearer [DYNTUBE_API_KEY]'
        },
        body: form
    };

    try {
        const response = await fetch('https://upload.dyntube.com/v1/videos', options);
        const result = await response.text();
        console.log(result);
    } catch (error) {
        throw new Error(error);
    }
};

// Call the method
uploadVideo();

Last updated