DynTube API
  • Welcome!
  • Key Concepts
  • Quick Start
  • Reference
    • Videos
      • Video Upload via File (Server Side)
      • Video Upload via URL (server side)
      • HTML-Form Client Side Video Uploads
      • Get Video Status
      • Get Videos
      • Get Video
      • Update Video
      • Delete Video
      • Download Original Video
      • Get Video for Mobile App/Custom Player
      • Update Video Image
      • Add Video Captions/Chapters/Subtitles
      • Delete Video Captions/Subtitles/Chapters
      • Create Expirable Links
      • Get Collected Emails
      • Setting Up Webhooks
      • Copy call-to-action (CTA) to Videos
      • Token Authentication
    • Projects
      • Create Project
      • Update a Project
      • Get Projects
      • Get a Project
      • Delete a Project
      • Set default CTA for Project
    • Live Streaming
      • Create a Live Stream
      • Update a Live Stream
      • Get Live Streams
      • Get a Live Stream
      • Count Live Streams
      • Live Streams Limit
      • Get Live Streaming Recording
      • Delete a Live Stream
      • Service and Regions for live streams
    • Channels
      • Get Channels
      • Get Channel
      • Delete Channel
    • Subscriptions
      • Create a Plan
      • Create a Member
      • Attach Plan To Member
      • Get Plans
      • Get Members
      • Get Member's Plans
      • Delete a Plan
    • Analytics
      • Use your User Ids in Analytics
      • Get Video Analytics
    • Javascript Events Methods
      • Plain Javascript Events & Methods
      • Control the Player using React
      • Control the Player in Vue.js
    • Developer Resources
      • How to embed DynTube player in Next.Js
      • How to embed the video player in React
      • How to play DynTube videos in React Native
      • ExoPlayer app to play HLS videos
      • How to embed videos & channels dynamically
      • How to Import Vimeo Videos into DynTube
Powered by GitBook
On this page
  • API URL
  • Upload Video via URL
  • Replace an Existing Video
  • API Request
  • Response
  • Node.js Code Example Using a URL to upload video
  1. Reference
  2. Videos

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

Name
Type
Description

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();
PreviousVideo Upload via File (Server Side)NextHTML-Form Client Side Video Uploads

Last updated 9 months ago

See more details here