Projects
Get a Project
Get a single project
This endpoint returns a single project with the provided ID.
GET https://api.dyntube.com/v1/projects/{id}
Headers
| Name | Type | Description |
|---|---|---|
| Authorization | String | Bearer YOUR_API_KEY |
Path Parameters
| Name | Type | Description |
|---|---|---|
| id | String | Project id |
200: OK Object in JSON format
json
{
"id": "z1S2lNdmg",
"key": "jOH3SJgVLmA",
"name": "Videos",
"description": "",
"region": "use-s",
"planType": 1,
"status": 1,
"created": "2020-06-07T18:08:34.714+00:00",
"updated": "2020-06-07T18:08:34.714+00:00"
}404: Project not found
json
{
"type": "https://tools.ietf.org/html/rfc7231#section-6.5.4",
"title": "Not Found",
"status": 404,
"traceId": "00-fc3d66e5001efa41d7ce56-c691caa6cf06b649-00"
}Code Samples
C\#
csharp
using System;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace Example
{
class Program
{
private static readonly HttpClient client = new HttpClient();
static async Task Main(string[] args)
{
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", "your_bearer_token");
var projectId = "your_project_id";
var url = $"https://api.dyntube.com/v1/projects/{projectId}";
var response = await client.GetAsync(url);
if (response.IsSuccessStatusCode)
{
var responseContent = await response.Content.ReadAsStringAsync();
var project = JsonConvert.DeserializeObject<Project>(responseContent);
Console.WriteLine($"Name: {project.Name}");
Console.WriteLine($"Description: {project.Description}");
Console.WriteLine($"Region: {project.Region}");
// ...
}
else
{
Console.WriteLine($"Failed to get project {projectId}. Status code: {response.StatusCode}");
}
}
}
class Project
{
public string Id { get; set; }
public string Key { get; set; }
public string Name { get; set; }
public string Description { get; set; }
public string Region { get; set; }
// ...
}
}Node.js
javascript
const axios = require('axios');
const projectId = 'your-project-id';
const bearerToken = 'your-bearer-token';
axios.get(`https://api.dyntube.com/v1/projects/${projectId}`, {
headers: {
Authorization: `Bearer ${bearerToken}`
}
})
.then(response => {
console.log(response.data);
})
.catch(error => {
console.error(error);
});Python
python
import requests
project_id = "MgLVvAV7"
bearer_token = "your_bearer_token"
remote_server_url = f"https://api.dyntube.com/v1/projects/{project_id}"
headers = {
"Authorization": f"Bearer {bearer_token}"
}
response = requests.get(remote_server_url, headers=headers)
if response.status_code == 200:
project = response.json()
print(f"Project name: {project['name']}")
else:
print(f"Failed to get project. Status code: {response.status_code}")PHP
php
<?php
$projectId = "MgLVvAV7";
$bearerToken = "your_bearer_token";
$url = "https://api.dyntube.com/v1/projects/{$projectId}";
$headers = [
"Authorization: Bearer {$bearerToken}",
"Content-Type: application/json",
];
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
$status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
curl_close($ch);
if ($status_code == 200) {
$project = json_decode($response);
echo "Project ID: {$project->id}\n";
echo "Project Name: {$project->name}\n";
//... other properties
} else {
echo "Failed to get project. Status code: {$status_code}\n";
}Related Pages
- Update a project to change project settings.
- Get videos to list videos inside a project with projectId.
- Create project to create another project or sub-project.
- AI Language Codes if the project uses AI transcription or translations.
Something missing or wrong here? Tell us and we will correct it. New to DynTube? Start with uploading and embedding.