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);

Last updated