Get channel

Retrieve details for a specific channel by its ID.

GET /v1/channels/{id}

Authentication

This endpoint requires authentication using a Bearer token.

Include the header:

Authorization: Bearer YOUR_API_KEY

Path Parameters

Parameter
Type
Required
Description

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

Field
Type
Description

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

Status Code
Description

401

Unauthorized - Invalid or missing API key

404

Not Found - Channel does not exist or you don't have access

500

Internal Server Error

Example Error Response
{
  "message": "Channel not found"
}

Code Examples

cURL
curl -X GET "https://api.dyntube.com/v1/channels/abc123xyz" \
  -H "Authorization: Bearer YOUR_API_KEY"

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