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
  • This endpoint will return the status of the video. The response will be a single-digit that represents the current status of the video.
  • Value of Video Status
  • C# Sample
  • Node.js Sample
  • Python Sample
  • PHP Sample
  1. Reference
  2. Videos

Get Video Status

This endpoint will return the status of the video. The response will be a single-digit that represents the current status of the video.

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

Path Parameters

Name
Type
Description

id*

String

Video Id. This is NOT the same as channelKey that is provided in the embed code. This is normally provided in the video list through API or through the dashboard.

3

A video status of 3 means that the video is published.

Value of Video Status

Below are the possible video status values:

Description of Status
Value

NA

0

Uploaded

1

Processing

2

Published

3

Error

-1

C# Sample

using System;
using System.Net.Http;
using System.Net.Http.Headers;

namespace VideoStatusCheck
{
    class Program
    {
        static void Main(string[] args)
        {
            string id = "your_video_id";
            string apiUrl = $"https://api.dyntube.com/v1/videos/{id}/status";
            string bearerToken = "your_bearer_token";

            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", bearerToken);

                var response = client.GetAsync(apiUrl).Result;

                if (response.IsSuccessStatusCode)
                {
                    string status = response.Content.ReadAsStringAsync().Result;
                    if (status == "3")
                    {
                        Console.WriteLine("The video has been published.");
                    }
                    else
                    {
                        Console.WriteLine("The video has not been published yet.");
                    }
                }
                else
                {
                    Console.WriteLine("Request failed: " + response.ReasonPhrase);
                }
            }
        }
    }
}

Node.js Sample

const axios = require('axios');

async function checkVideoStatus(videoId, bearerToken) {
    try {
        const response = await axios.get(`https://api.dyntube.com/v1/videos/${videoId}/status`, {
            headers: {
                Authorization: `Bearer ${bearerToken}`
            }
        });

        const status = response.data;

        if (status === '3') {
            console.log('The video has been published.');
        } else {
            console.log('The video has not been published yet.');
        }
    } catch (error) {
        console.error(error);
    }
}

checkVideoStatus('your_video_id', 'your_bearer_token');

Python Sample

const axios = require('axios');

async function checkVideoStatus(videoId, bearerToken) {
    try {
        const response = await axios.get(`https://api.dyntube.com/v1/videos/${videoId}/status`, {
            headers: {
                Authorization: `Bearer ${bearerToken}`
            }
        });

        const status = response.data;

        if (status === '3') {
            console.log('The video has been published.');
        } else {
            console.log('The video has not been published yet.');
        }
    } catch (error) {
        console.error(error);
    }
}

checkVideoStatus('your_video_id', 'your_bearer_token');

PHP Sample

function check_video_status($video_id, $bearer_token) {
  $headers = [
    "Authorization: Bearer $bearer_token"
  ];

  $ch = curl_init("https://api.dyntube.com/v1/videos/$video_id/status");
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  $response = curl_exec($ch);
  $http_status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
  curl_close($ch);

  if ($http_status == 200) {
    $status = json_decode($response);
    if ($status == '3') {
      echo "The video has been published.\n";
    } else {
      echo "The video has not been published yet.\n";
    }
  } else {
    echo "Error checking video status. Status code: $http_status\n";
  }
}
PreviousHTML-Form Client Side Video UploadsNextGet Videos

Last updated 2 years ago