Key concepts

Key Concepts

Review these concepts before building against the API. They explain the base URL, versioning, plan types, and region codes used throughout the endpoint reference.

API URL

The URL to make API calls is

example
https://api.dyntube.com/v1/

API Version

Plan Types

Some of the API endpoints need a field planType or storePlanType. Whenever you are required to provide this field, you can use the following endpoint to get the planType.

GET https://api.dyntube.com/v1/account/plans

You can use the value of the field "type" from the JSON response.

200: OK

json

  [
    {
        "name": "Standard",
        "type": 1,
        "created": "2018-05-09T09:13:51.1283277+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 response = await client.GetAsync("https://api.dyntube.com/v1/account/plans");
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 getAccountPlans() {
  const response = await axios.get('https://api.dyntube.com/v1/account/plans', {
    headers: { Authorization: 'Bearer YOUR_API_KEY' }
  });

  console.log(response.data);
}

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

Python

python
import requests

response = requests.get(
    "https://api.dyntube.com/v1/account/plans",
    headers={"Authorization": "Bearer YOUR_API_KEY"},
)
response.raise_for_status()
print(response.json())

PHP

php
<?php
$ch = curl_init('https://api.dyntube.com/v1/account/plans');
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;

Region Codes

Some API operations require a region. For example, creating a project requires both region and planType values.

Use the region code that matches where you want videos stored and processed.

Region Codes for Video Hosting

Use these region codes when creating projects or uploading videos.

REGION NAME / CODE
REGION NAMECODE
US Eastuse-s
US Westusw-s
US Centralusc-s
Canadacan-s
Netherlandseuc-s
Germanydeu-s
Francefra-s
United Kingdomgbr-s
Singaporesgp-s
Australiaaus-s
Japanapn-s

Region Codes for Live Streaming

Use these region codes when creating live streams.

REGION NAME / CODE
REGION NAMECODE
US Eastuse
Europeeuc
Singaporesgp
Indiaind
  • Create project for region, planType, and project settings in a real request.
  • Video upload via file for upload fields that use project and plan values.
  • Create a live stream for live streaming region and service values.
  • AI Language Codes for transcription and translation language values.

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