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
  • Get a single channel
  • This endpoint will return a single channel with the provided Id.
  • Code Samples
  • C#
  • Node
  • Python
  • PHP
  1. Reference
  2. Channels

Get Channel

Get a single channel

This endpoint will return a single channel with the provided Id.

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

Path Parameters

Name
Type
Description

id

String

Channel id

{
            "id": "WbuG0e4aJJgudbA",
            "key": "Tz6NAPOhVgTGX6A",
            "name": "demo.dyntube.io",
            "description": "",
            "accountId": "bG4bUdcNASQ",
            "version": 1,
            "planType": 1,
            "templateKey": "62828610006",
            "status": 1,
            "created": "2020-05-19T10:05:48.2496031+00:00",
            "updated": "2020-05-19T10:05:48.2496036+00:00"
        }

Code Samples

C#

using System;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

namespace HttpClientExample
{
    class Program
    {
        static async Task Main(string[] args)
        {
            string channelId = "Yy95faA";
            string url = $"https://api.dyntube.com/v1/channels/{channelId}";

            using (var httpClient = new HttpClient())
            {
                var response = await httpClient.GetAsync(url);

                if (response.IsSuccessStatusCode)
                {
                    var responseContent = await response.Content.ReadAsStringAsync();
                    var responseData = JsonConvert.DeserializeObject<dynamic>(responseContent);

                    Console.WriteLine("Channel ID: " + responseData.id);
                    Console.WriteLine("Channel Name: " + responseData.name);
                    Console.WriteLine("Channel Description: " + responseData.description);
                    Console.WriteLine("Channel Account ID: " + responseData.accountId);
                    Console.WriteLine("Channel Created: " + responseData.created);
                    Console.WriteLine("Channel Updated: " + responseData.updated);
                }
                else
                {
                    Console.WriteLine("GET request failed with status code: " + response.StatusCode);
                }
            }
        }
    }
}

Node

const fetch = require('node-fetch');

const channelId = 'Yy95faA';
const url = `https://api.dyntube.com/v1/channels/${channelId}`;
const options = {
  method: 'GET',
};

fetch(url, options)
  .then(res => res.json())
  .then(data => {
    console.log('Channel ID:', data.id);
    console.log('Channel Name:', data.name);
    console.log('Channel Description:', data.description);
    console.log('Channel Account ID:', data.accountId);
    console.log('Channel Created:', data.created);
    console.log('Channel Updated:', data.updated);
  })
  .catch(err => console.error('GET request failed with error:', err));
ja

Python

import requests

channel_id = 'Yy95faA'
url = f'https://api.dyntube.com/v1/channels/{channel_id}'
headers = {'Content-Type': 'application/json'}

response = requests.get(url, headers=headers)

if response.status_code == 200:
    data = response.json()
    print('Channel ID:', data['id'])
    print('Channel Name:', data['name'])
    print('Channel Description:', data['description'])
    print('Channel Account ID:', data['accountId'])
    print('Channel Created:', data['created'])
    print('Channel Updated:', data['updated'])
else:
    print(f'GET request failed with status code: {response.status_code}')

PHP

<?php

$channel_id = 'Yy95faA';
$url = "https://api.dyntube.com/v1/channels/{$channel_id}";
$headers = array('Content-Type: application/json');

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);

if ($response === false) {
    echo 'GET request failed: ' . curl_error($ch);
} else {
    $httpStatus = curl_getinfo($ch, CURLINFO_HTTP_CODE);
    if ($httpStatus == 200) {
        $data = json_decode($response, true);
        echo 'Channel ID: ' . $data['id'] . PHP_EOL;
        echo 'Channel Name: ' . $data['name'] . PHP_EOL;
        echo 'Channel Description: ' . $data['description'] . PHP_EOL;
        echo 'Channel Account ID: ' . $data['accountId'] . PHP_EOL;
        echo 'Channel Created: ' . $data['created'] . PHP_EOL;
        echo 'Channel Updated: ' . $data['updated'] . PHP_EOL;
    } else {
        echo 'GET request failed with status code: ' . $httpStatus;
    }
}

curl_close($ch);

PreviousGet ChannelsNextDelete Channel

Last updated 2 years ago