Get channel
Retrieve details for a specific channel by its ID.
GET /v1/channels/{id}Authentication
This endpoint requires authentication using a Bearer token.
Path Parameters
id
string
Yes
The unique channel identifier
Response
Success Response
Status Code: 200 OK
{
"id": "abc123xyz",
"key": "ch_def456",
"name": "Product Tutorials",
"description": "Video tutorials for our product lineup",
"accountId": "acc_789",
"version": 1,
"planType": 2,
"templateKey": "tmpl_modern",
"status": 1,
"created": "2024-01-15T10:30:00Z",
"updated": "2024-01-20T14:45:00Z"
}Response Fields
id
string
Internal channel identifier
key
string
Public channel key (use for embedding)
name
string
Channel display name
description
string
Channel description
accountId
string
Owner account identifier
version
integer
Channel version number
planType
integer
Associated plan type
templateKey
string
Applied template key
status
integer
Channel status (1 = Published)
created
datetime
Creation timestamp (ISO 8601)
updated
datetime
Last update timestamp (ISO 8601)
Error Responses
401
Unauthorized - Invalid or missing API key
404
Not Found - Channel does not exist or you don't have access
500
Internal Server Error
Code Examples
curl -X GET "https://api.dyntube.com/v1/channels/abc123xyz" \
-H "Authorization: Bearer YOUR_API_KEY"const channelId = 'abc123xyz';
const response = await fetch(
`https://api.dyntube.com/v1/channels/${channelId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (response.ok) {
const channel = await response.json();
console.log(`Channel: ${channel.name}`);
console.log(`Key: ${channel.key}`);
console.log(`Description: ${channel.description}`);
} else if (response.status === 404) {
console.log('Channel not found');
}import requests
channel_id = 'abc123xyz'
response = requests.get(
f'https://api.dyntube.com/v1/channels/{channel_id}',
headers={'Authorization': 'Bearer YOUR_API_KEY'}
)
if response.status_code == 200:
channel = response.json()
print(f"Channel: {channel['name']}")
print(f"Key: {channel['key']}")
print(f"Description: {channel['description']}")
elif response.status_code == 404:
print('Channel not found')<?php
$channelId = 'abc123xyz';
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://api.dyntube.com/v1/channels/{$channelId}");
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) {
$channel = json_decode($response, true);
echo "Channel: " . $channel['name'] . "\n";
echo "Key: " . $channel['key'] . "\n";
echo "Description: " . $channel['description'] . "\n";
} elseif ($httpCode === 404) {
echo "Channel not found\n";
}Use Cases
Verify Channel Exists Before Embedding
async function getChannelForEmbed(channelId) {
const response = await fetch(
`https://api.dyntube.com/v1/channels/${channelId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (!response.ok) {
throw new Error('Channel not found');
}
const channel = await response.json();
return {
embedKey: channel.key,
title: channel.name,
description: channel.description
};
}Check Channel Status
async function isChannelPublished(channelId) {
const response = await fetch(
`https://api.dyntube.com/v1/channels/${channelId}`,
{
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
}
}
);
if (!response.ok) {
return false;
}
const channel = await response.json();
return channel.status === 1; // 1 = Published
}See Also
List Channels - Get all channels
Update Channel - Modify a channel
Delete Channel - Remove a channel
Channels API Overview - API overview and authentication