Projects

Get Projects

Get Project List

Get a list of projects. Use optional query parameters to filter or sort the result.

GET https://api.dyntube.com/v1/projects

Headers

Name / Type / Description
NameTypeDescription
AuthorizationStringBearer YOUR_API_KEY

Query Parameters

Name / Type / Description
NameTypeDescription
pageIntegerPage number
sizeIntegerPage size
planTypeIntegerType of the plan
sortStringSort order of the results. See details below.
projectIdStringID of the project
parentIdStringProject ID of the parent project.

200: OK Response returns a list of projects and a pager.

json
{
    "pager": {
        "page": 1,
        "totalPages": 1,
        "totalResults": 49,
        "sort": "name:-1"
    },
    "projects": [
        {
            "id": "z1S2lNdmg",
            "key": "jOH3SJgVLmA",
            "name": "Videos",
            "description": "",
            "region": "use-s",
            "planType": 1,
            "options": {
                "convertToHls": true,
                "convertToMp4": false,
                "convertToOneMp4": true,
                "useOriginalMp4": false,
                "hlsEncrypt": false,
                "bitrate240p": 400,
                "bitrate360p": 1200,
                "bitrate540p": 1800,
                "bitrate720p": 3750,
                "bitrate1080p": 5625,
                "bitrate1440p": 0,
                "bitrate2160p": 0,
                "saveOriginalVideos": false
            },
            "videoOptions": {
                "autoplay": false,
                "playerSkin": "solid",
                "controlsColor": "",
                "primaryColor": "",
                "seekButtons": false,
                "volumeControl": true,
                "preload": "auto",
                "fullscreenControl": true,
                "controls": true,
                "captionsOn": false,
                "bigPlayControl": true,
                "defaultQuality": "",
                "qualityControl": true,
                "speedControl": true,
                "fastForward": true,
                "volume": 1.0,
                "loop": false,
                "muted": false,
                "landscapeFullscreen": false,
                "modal": false,
                "resumePlayback": false,
                "hideLogo": false,
                "cast": false,
                "extraSecurity": false,
                "stickyPlayer": false,
                "pauseOnScroll": false,
                "storeAuth": false,
                "contextMenu": false
            },
            "status": 1,
            "created": "2020-06-07T18:08:34.714+00:00",
            "updated": "2020-06-07T18:08:34.714+00:00"
        }
    ]
}

Code Samples

C#

csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;

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

var url = "https://api.dyntube.com/v1/projects?page=1&size=20&sort=Created:-1";
var response = await client.GetAsync(url);
var body = await response.Content.ReadAsStringAsync();

if (!response.IsSuccessStatusCode)
{
    throw new Exception($"Request failed: {(int)response.StatusCode} {body}");
}

Console.WriteLine(body);

Node.js

javascript
const axios = require('axios');

async function getProjects() {
  const response = await axios.get('https://api.dyntube.com/v1/projects', {
    params: {
      page: 1,
      size: 20,
      sort: 'Created:-1'
    },
    headers: {
      Authorization: 'Bearer YOUR_API_KEY'
    }
  });

  console.log(response.data);
}

getProjects().catch(error => {
  console.error(error.response?.data || error.message);
});

Python

python
import requests

response = requests.get(
    "https://api.dyntube.com/v1/projects",
    params={"page": 1, "size": 20, "sort": "Created:-1"},
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
response.raise_for_status()
print(response.json())

PHP

php
<?php
$query = http_build_query([
    'page' => 1,
    'size' => 20,
    'sort' => 'Created:-1',
]);

$ch = curl_init("https://api.dyntube.com/v1/projects?{$query}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    'Authorization: Bearer YOUR_API_KEY',
]);

$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);

if ($httpCode < 200 || $httpCode >= 300) {
    throw new Exception("Request failed with status {$httpCode}: {$response}");
}

echo $response;

Error Responses

Status Code / Description
Status CodeDescription
400Bad Request - Invalid query parameters
401Unauthorized - Invalid or missing API key

Sorting of results

Use the sort query parameter to order projects. The format is field:1 for ascending order or field:-1 for descending order.

yaml
# Here are examples to sort by "Created" date.

#Sort by date created descending:
https://api.dyntube.com/v1/projects?sort=Created:-1

#Sort by date created ascending:
https://api.dyntube.com/v1/projects?sort=Created:1
  • Create project to add a new project.
  • Get a project to inspect a single project.
  • Update a project to change project settings.
  • Get videos to list videos by projectId.

Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.