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
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
[
{
"name": "Standard",
"type": 1,
"created": "2018-05-09T09:13:51.1283277+00:00"
}
]Code Samples
C#
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
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
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
$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 |
|---|---|
| US East | use-s |
| US West | usw-s |
| US Central | usc-s |
| Canada | can-s |
| Netherlands | euc-s |
| Germany | deu-s |
| France | fra-s |
| United Kingdom | gbr-s |
| Singapore | sgp-s |
| Australia | aus-s |
| Japan | apn-s |
Region Codes for Live Streaming
Use these region codes when creating live streams.
| REGION NAME | CODE |
|---|---|
| US East | use |
| Europe | euc |
| Singapore | sgp |
| India | ind |
Related Pages
- 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.