<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Using Youtube Data v3  API in CMS Development</title>
    <link>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/350201#M17264</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/136243"&gt;@fah08&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can embed a playlist of a YouTube user's videos very easily (it will display all in one video frame):&lt;/P&gt;&lt;PRE&gt;&amp;lt;iframe src="http://www.youtube.com/embed/?listType=user_uploads&amp;amp;list=[CHANNEL_NAME]" width="480" height="400"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/PRE&gt;&lt;P&gt;The YouTube iFrame API will be more useful if you go down this route:&amp;nbsp;&lt;A href="https://developers.google.com/youtube/iframe_api_reference" target="_blank"&gt;https://developers.google.com/youtube/iframe_api_reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to do anything more complicated than that using the YouTube API, you can make an AJAX call in Javascript to the API. Something like:&lt;/P&gt;&lt;PRE&gt;$.ajax({
  url: "https://www.googleapis.com/youtube/v3/playlists",
  type: 'GET',
  dataType: 'json',
  data: {
    part : 'snippet', 
    channelId: [CHANNEL ID],
    maxResults : 50,
    key: '[API KEY]', 
  },
  success: function(data) {
    // do things with the result
  },
  error: function(xhr, status, error) {
    // handle any errors e.g. &lt;BR /&gt;    console.log(xhr.responseText);
  }
}); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;However, this will expose your API key to the public&lt;/STRONG&gt;&amp;nbsp;(and&amp;nbsp;OAuth 2.0 client ID if you use that), unless you&amp;nbsp;&lt;SPAN&gt;proxy the requests from your frontend JS through a separate server that can process the request and then make an authenticated request to YouTube.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option I think would work is to make your own Hubspot app which would allow you to hide your credentials (documentation &lt;A href="https://legacydocs.hubspot.com/docs/faq/how-do-i-create-an-app-in-hubspot" target="_blank" rel="noopener"&gt;here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a Hubspot-made &lt;A href="https://ecosystem.hubspot.com/marketplace/apps/marketing/social-media/youtube" target="_blank" rel="noopener"&gt;YouTube app&lt;/A&gt; in the App Marketplace, but I'm not sure you can pull videos using it, I think it's for pulling analytics data from YouTube but worth checking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jun 2020 14:19:03 GMT</pubDate>
    <dc:creator>piersg</dc:creator>
    <dc:date>2020-06-26T14:19:03Z</dc:date>
    <item>
      <title>Using Youtube Data v3  API</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/349071#M17194</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am working on the page that helps me pull all the videos from a youtube channel.&amp;nbsp; The aim is t auto populate the vidoes instead of myself updating/uploading new videos in the site.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What is the best way to acheive this? I planned to use youtube data v3 api. But How can this be done in hubspot cms?&lt;/P&gt;</description>
      <pubDate>Tue, 23 Jun 2020 05:42:42 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/349071#M17194</guid>
      <dc:creator>fah08</dc:creator>
      <dc:date>2020-06-23T05:42:42Z</dc:date>
    </item>
    <item>
      <title>Re: Using Youtube Data v3  API</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/350133#M17247</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hey&amp;nbsp;&lt;/SPAN&gt;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/136243"&gt;@fah08&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I'll tag a few of our experts to see if they have been using this integration. &amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Hey&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/103660"&gt;@piersg&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/17186"&gt;@Anton&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/92197"&gt;@albertsg&lt;/a&gt;&amp;nbsp;&amp;nbsp;could you please share your thoughts with&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/136243"&gt;@fah08&lt;/a&gt;?&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt; thanks &amp;amp; happy Friday!&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Sharon&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 10:08:44 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/350133#M17247</guid>
      <dc:creator>sharonlicari</dc:creator>
      <dc:date>2020-06-26T10:08:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using Youtube Data v3  API</title>
      <link>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/350201#M17264</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.hubspot.com/t5/user/viewprofilepage/user-id/136243"&gt;@fah08&lt;/a&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can embed a playlist of a YouTube user's videos very easily (it will display all in one video frame):&lt;/P&gt;&lt;PRE&gt;&amp;lt;iframe src="http://www.youtube.com/embed/?listType=user_uploads&amp;amp;list=[CHANNEL_NAME]" width="480" height="400"&amp;gt;&amp;lt;/iframe&amp;gt;&lt;/PRE&gt;&lt;P&gt;The YouTube iFrame API will be more useful if you go down this route:&amp;nbsp;&lt;A href="https://developers.google.com/youtube/iframe_api_reference" target="_blank"&gt;https://developers.google.com/youtube/iframe_api_reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If you want to do anything more complicated than that using the YouTube API, you can make an AJAX call in Javascript to the API. Something like:&lt;/P&gt;&lt;PRE&gt;$.ajax({
  url: "https://www.googleapis.com/youtube/v3/playlists",
  type: 'GET',
  dataType: 'json',
  data: {
    part : 'snippet', 
    channelId: [CHANNEL ID],
    maxResults : 50,
    key: '[API KEY]', 
  },
  success: function(data) {
    // do things with the result
  },
  error: function(xhr, status, error) {
    // handle any errors e.g. &lt;BR /&gt;    console.log(xhr.responseText);
  }
}); &lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;However, this will expose your API key to the public&lt;/STRONG&gt;&amp;nbsp;(and&amp;nbsp;OAuth 2.0 client ID if you use that), unless you&amp;nbsp;&lt;SPAN&gt;proxy the requests from your frontend JS through a separate server that can process the request and then make an authenticated request to YouTube.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another option I think would work is to make your own Hubspot app which would allow you to hide your credentials (documentation &lt;A href="https://legacydocs.hubspot.com/docs/faq/how-do-i-create-an-app-in-hubspot" target="_blank" rel="noopener"&gt;here&lt;/A&gt;).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is a Hubspot-made &lt;A href="https://ecosystem.hubspot.com/marketplace/apps/marketing/social-media/youtube" target="_blank" rel="noopener"&gt;YouTube app&lt;/A&gt; in the App Marketplace, but I'm not sure you can pull videos using it, I think it's for pulling analytics data from YouTube but worth checking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jun 2020 14:19:03 GMT</pubDate>
      <guid>https://community.hubspot.com/t5/CMS-Development/Using-Youtube-Data-v3-API/m-p/350201#M17264</guid>
      <dc:creator>piersg</dc:creator>
      <dc:date>2020-06-26T14:19:03Z</dc:date>
    </item>
  </channel>
</rss>

