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

Get a Project

Get a single project

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

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

Path Parameters

Name
Type
Description

id

String

Project id

{
    "type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
    "title": "Not Found",
    "status": 404,
    "traceId": "00-fc3d66e5001efa41d7ce56-c691caa6cf06b649-00"
}

Code Samples

C#

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

namespace Example
{
    class Program
    {
        private static readonly HttpClient client = new HttpClient();

        static async Task Main(string[] args)
        {
            client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "your_bearer_token");

            var projectId = "your_project_id";
            var url = $"https://api.dyntube.com/v1/projects/{projectId}";

            var response = await client.GetAsync(url);

            if (response.IsSuccessStatusCode)
            {
                var responseContent = await response.Content.ReadAsStringAsync();
                var project = JsonConvert.DeserializeObject<Project>(responseContent);
                Console.WriteLine($"Name: {project.Name}");
                Console.WriteLine($"Description: {project.Description}");
                Console.WriteLine($"Region: {project.Region}");
                // ...
            }
            else
            {
                Console.WriteLine($"Failed to get project {projectId}. Status code: {response.StatusCode}");
            }
        }
    }

    class Project
    {
        public string Id { get; set; }
        public string Key { get; set; }
        public string Name { get; set; }
        public string Description { get; set; }
        public string Region { get; set; }
        // ...
    }
}

Node.js

const axios = require('axios');

const projectId = 'your-project-id';
const bearerToken = 'your-bearer-token';

axios.get(`https://api.dyntube.com/v1/projects/${projectId}`, {
    headers: {
        Authorization: `Bearer ${bearerToken}`
    }
})
.then(response => {
    console.log(response.data);
})
.catch(error => {
    console.error(error);
});

Python

import requests

project_id = "MgLVvAV7"
bearer_token = "your_bearer_token"
remote_server_url = f"https://api.dyntube.com/v1/projects/{project_id}"

headers = {
    "Authorization": f"Bearer {bearer_token}"
}

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

if response.status_code == 200:
    project = response.json()
    print(f"Project name: {project['name']}")
else:
    print(f"Failed to get project. Status code: {response.status_code}")

PHP

<?php

$projectId = "MgLVvAV7";
$bearerToken = "your_bearer_token";
$url = "https://api.dyntube.com/v1/projects/{$projectId}";

$headers = [
    "Authorization: Bearer {$bearerToken}",
    "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);
$status_code = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);

if ($status_code == 200) {
    $project = json_decode($response);
    echo "Project ID: {$project->id}\n";
    echo "Project Name: {$project->name}\n";
    //... other properties
} else {
    echo "Failed to get project. Status code: {$status_code}\n";
}

PreviousGet ProjectsNextDelete a Project

Last updated 2 years ago