DynTube API
  • Welcome!
  • Key Concepts
  • Quick Start
  • Reference
    • Videos
      • Video Upload via File (Server Side)
      • Video Upload via URL (server side)
      • HTML-Form Client Side Video Uploads
      • Get Video Status
      • Get Videos
      • Get Video
      • Update Video
      • Delete Video
      • Download Original Video
      • Get Video for Mobile App/Custom Player
      • Update Video Image
      • Add Video Captions/Chapters/Subtitles
      • Delete Video Captions/Subtitles/Chapters
      • Create Expirable Links
      • Get Collected Emails
      • Setting Up Webhooks
      • Copy call-to-action (CTA) to Videos
      • Token Authentication
    • Projects
      • Create Project
      • Update a Project
      • Get Projects
      • Get a Project
      • Delete a Project
      • Set default CTA for Project
    • Live Streaming
      • Create a Live Stream
      • Update a Live Stream
      • Get Live Streams
      • Get a Live Stream
      • Count Live Streams
      • Live Streams Limit
      • Get Live Streaming Recording
      • Delete a Live Stream
      • Service and Regions for live streams
    • Channels
      • Get Channels
      • Get Channel
      • Delete Channel
    • Subscriptions
      • Create a Plan
      • Create a Member
      • Attach Plan To Member
      • Get Plans
      • Get Members
      • Get Member's Plans
      • Delete a Plan
    • Analytics
      • Use your User Ids in Analytics
      • Get Video Analytics
    • Javascript Events Methods
      • Plain Javascript Events & Methods
      • Control the Player using React
      • Control the Player in Vue.js
    • Developer Resources
      • How to embed DynTube player in Next.Js
      • How to embed the video player in React
      • How to play DynTube videos in React Native
      • ExoPlayer app to play HLS videos
      • How to embed videos & channels dynamically
      • How to Import Vimeo Videos into DynTube
Powered by GitBook
On this page
  • Get Collected Emails
  • C# Sample
  • Python
  • Node.js
  • PHP
  1. Reference
  2. Videos

Get Collected Emails

This API endpoint provides a convenient way to download all of the email addresses that have been collected during video playbacks. By making a request to this endpoint, you will receive a JSON response containing all of the email addresses that were collected over the last year.

This can be a useful tool for businesses and organizations that want to keep track of their customers and leads. By collecting email addresses during video playbacks, they can create targeted marketing campaigns and stay in touch with their audience.

Get Collected Emails

GET https://api.dyntube.com/v1/videos/collected-emails


[
    {
        "fullName": "joe man",
        "email": "me@example.com",
        "mobileNumber": "1234345636",
        "videoKey": "qXCgdf566c2Jz0g",
        "channelKey": "AazRUsad4567gMDC2Q",
        "created": "2019-02-23T10:24:45.205Z"
    }
]

C# Sample

using System;
using System.Collections.Generic;
using System.Net.Http;
using System.Threading.Tasks;
using Newtonsoft.Json;

class Program
{
    static async Task Main(string[] args)
    {
        string url = "https://api.dyntube.com/v1/videos/collected-emails";
        string token = "YOUR_BEARER_TOKEN"; // Replace with your actual Bearer token

        using (HttpClient client = new HttpClient())
        {
            client.DefaultRequestHeaders.Authorization = new System.Net.Http.Headers.AuthenticationHeaderValue("Bearer", token);

            HttpResponseMessage response = await client.GetAsync(url);
            if (response.IsSuccessStatusCode)
            {
                string jsonResponse = await response.Content.ReadAsStringAsync();
                var emailList = JsonConvert.DeserializeObject<List<Email>>(jsonResponse);

                // Access the email data
                foreach (var email in emailList)
                {
                    Console.WriteLine($"Full Name: {email.FullName}");
                    Console.WriteLine($"Email: {email.Email}");
                    Console.WriteLine($"Mobile Number: {email.MobileNumber}");
                    Console.WriteLine($"Video Key: {email.VideoKey}");
                    Console.WriteLine($"Channel Key: {email.ChannelKey}");
                    Console.WriteLine($"Created: {email.Created}");
                }
            }
        }
    }
}

public class Email
{
    public string FullName { get; set; }
    public string Email { get; set; }
    public string MobileNumber { get; set; }
    public string VideoKey { get; set; }
    public string ChannelKey { get; set; }
    public DateTime Created { get; set; }
}

Python

import requests
import json

url = "https://api.dyntube.com/v1/videos/collected-emails"
token = "YOUR_BEARER_TOKEN" # Replace with your actual Bearer token

headers = {"Authorization": "Bearer " + token}
response = requests.get(url, headers=headers)

if response.status_code == 200:
    email_list = json.loads(response.text)
    for email in email_list:
        print(f"Full Name: {email['fullName']}")
        print(f"Email: {email['email']}")
        print(f"Mobile Number: {email['mobileNumber']}")
        print(f"Video Key: {email['videoKey']}")
        print(f"Channel Key: {email['channelKey']}")
        print(f"Created: {email['created']}")
else:
    print(f"Failed to retrieve emails: {response.text}")

Node.js

const axios = require('axios');

const url = 'https://api.dyntube.com/v1/videos/collected-emails';
const token = 'YOUR_BEARER_TOKEN'; // Replace with your actual Bearer token

const config = {
  headers: { 'Authorization': 'Bearer ' + token }
};

axios.get(url, config)
  .then(response => {
    const emailList = response.data;
    emailList.forEach(email => {
      console.log(`Full Name: ${email.fullName}`);
      console.log(`Email: ${email.email}`);
      console.log(`Mobile Number: ${email.mobileNumber}`);
      console.log(`Video Key: ${email.videoKey}`);
      console.log(`Channel Key: ${email.channelKey}`);
      console.log(`Created: ${email.created}`);
    });
  })
  .catch(error => {
    console.log(`Failed to retrieve emails: ${error.response.data}`);
  });

PHP

$url = 'https://api.dyntube.com/v1/videos/collected-emails';
$token = 'YOUR_BEARER_TOKEN'; // Replace with your actual Bearer token

$curl = curl_init($url);
$headers = array(
    'Authorization: Bearer ' . $token,
    'Content-Type: application/json'
);
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

$response = curl_exec($curl);
if (!$response) {
    die("Failed to retrieve emails: " . curl_error($curl));
}

$email_list = json_decode($response, true);
foreach ($email_list as $email) {
    echo "Full Name: " . $email['fullName'] . "\n";
    echo "Email: " . $email['email'] . "\n";
    echo "Mobile Number: " . $email['mobileNumber'] . "\n";
    echo "Video Key: " . $email['videoKey'] . "\n";
    echo "Channel Key: " . $email['channelKey'] . "\n";
    echo "Created: " . $email['created'] . "\n\n";
}

curl_close($curl);
PreviousCreate Expirable LinksNextSetting Up Webhooks

Last updated 2 years ago