YouTube Search Gallery
~ YouTube Plugin ~
What Does This Plugin Do?
Level of Difficulty: Medium
Compatibility: Chatfuel, ManyChat
*Important Note about YouTube Plugin
- Interactions: This plugin will use 1 interaction each time a new gallery is generated for a user
- Requirements: This plugin requires that you have a Google Account and create a YouTube API Key
- YouTube Google API limit: There’s typically a limit of 10,000 units per day. Each time a new gallery is generated, it will use up 100 units (accurate as of June 1st 2019). This is separate from the CodelessBot interactions. For the latest quotas, go to https://developers.google.com/youtube/v3/docs/search/list
Example Use Cases
Search YouTube Videos
Allow users to search your YouTube videos directly in your bot!
Topic-Specific Videos
Display your most popular videos based on a specific keyword
Popular Videos
Create an gallery with your most popular or most recent YouTube videos
How-To Setup the Plugin
Follow the 3 Simple Steps...or Login to CodelessBot to access the Plugin Wizard!
Step 1. Download & Install the Quick-Start Plugin Template
Login to CodelessBot, navigate to Templates on the sidebar and download the Quick-Start Template. Follow the prompt to install the Template. Next, you'll need to create a copy of the template for this specific plugin. See and follow the instructions below.
(If you've already install the Quick Start Template and created a copy of the plugin template - skip this step!
Chatfuel Instructions
a. From your Chatfuel dashboard, open the new bot called "JSON API Tutorial & CodelessBot Template"
b. Find the group containing the name of this plugin.
c. Click on the arrow next to the plugin name to clone this group and blocks from the template into your own Chatfuel Bot.
d. Navigate back to the Chatfuel Dashboard
e. Open your Bot and find the new plugin group that you just cloned.
f. Open the new Plugin block and enter in your CodelessBot access key and secret key.
Tip: Rename the plugin block to something more meaningful. For more details, refer to the Getting Started Guide.
ManyChat Instructions
After you download and installed the Quick Start Template...
- From the ManyChat sidebar, click on the Flows"
- Open the folder "CodelessBot Templates"
- Find the flow containing the name of this plugin.
- Create a copy by click on the three dots icon on the right
- Then click on duplicate
- Feel free to rename this new flow and move it to a different folder
- Open up the flow and click on the "Starting Step" to modify the information you'll be sending to CodelessBot
For more details, refer to the Getting Started Guide.
Step 2. Send information to CodelessBot
To quickly do this, use the
to answer a few questions. It'll then generate the code with the information below for you to copy and paste into your bot.cbot_apikey
Your YouTube API ID
More Detail
To create a YouTube API key, just follow our step-by-step guide. It should take you a few minutes to set this up.
cbot_search
The search term.
More Detail
You can enter in a value manually or send a custom field/attribute.
If you want to display the first 10 videos based on a specific order using the cbot_sort, enter in:
- “” for ManyChat
- not set for Chatfuel
cbot_channel_id
Your YouTube Channel ID. You’ll need to log into your YouTube account to find this information.
More Detail
- To find your Channel ID, sign in to your YouTube account.
- In the top right, click your account icon then on the settings gear icon.
- On the left-hand side, click Advanced Settings. You’ll see your channel ID under “Account information”.
cbot_video_button
The title for the button that takes users to your Youtube video
More Detail
(Max: 40 characters)
eg. “Watch Now” or “Play Video”
cbot_max_videos
The number of cards in your video gallery (between 1 to 10)
More Detail
A gallery can only show up to a max of 10 cards.
If you enter in “10” and you want to display the optional YouTube Channel Card, then only 9 video cards will be displayed.
cbot_sort
Your search results can be sorted by: date, title, relevance, rating or views
More Detail
- date – video cards are displayed in reverse chronological order based on the date they were created
- title – video cards are sorted alphabetically by title
- relevance – video cards are displayed based on their relevance to the search term
- rating – video cards are displayed from highest rating to lowest rating
- views – video cards are displayed from highest to lowest number of views
cbot_no_result
If no results are found, this custom message will be sent to users
More Detail
For example, “Sorry! We couldn’t find any videos matching that search!”
cbot_channel_title (Optional)
Your YouTube channel title
More Detail
This text will appear as the card title (Max: 45 characters)
cbot_channel_button (Optional)
The title for the button that will take users to your YouTube channel
More Detail
(Max: 40 characters)
eg. “Watch on YouTube” or “Go to YouTube” or “More Videos”
cbot_subscribe_button (Optional)
The title for the button that will subscribe users to your YouTube channel
More Detail
(Max: 40 characters)
eg. “Subscribe on YouTube”
Chatfuel Instructions
- In this plugin block, scroll down to the "JSON API" card
- Copy and paste the code from the Plugin Wizard into the textbox. (Or you can enter the correct value by referring to the descriptions above.)
Tip: Make sure the "Send as" is set to JSON. Not URL encoded or Full JSON Profile.
ManyChat Instructions
a. Click over to the "Body" tab in this external request
b. Next, copy and paste the code from the Plugin Wizard into the "Request Body". (Or you can enter the correct value by referring to the descriptions above.)
c. If there are any "Replace With placeholder" in the code, you'll need to replace them with the correct matching custom field by clicking on "Add a Variable".
d. To check if you set this up correctly, click on "Test the Request" on the right and you should get a success "200 OK" response
e. Click on the blue "Save" button
Step 3. CodelessBot will reply with the Gallery
CodelessBot will automatically send back a gallery!
More Information
FAQs
1. How are interactions calculated for this plugin?
This plugin will use 1 interaction each time a brand new YouTube gallery is generated.
2. Is there a limit on the number of queries to YouTube?
There’s typically a limit of 10,000 units per day. Each time a new gallery is generated, it will use up 100 units (accurate as of June 1st 2019). This is separate from the CodelessBot interactions.
For the latest quotas, go to https://developers.google.com/youtube/v3/docs/search/list
3. Where can I create/find my YouTube API Key?
If you don’t have an existing YouTube API Key, you’ll need to create one. You can find step-by-step instructions here.
If you already created a key, you can find it by logging into https://console.developers.google.com
4. How do I create a gallery of my most popular videos?
Follow the instructions above. Be sure to enter “views” for cbot_sort and for cbot_search, enter the value:
- “” for ManyChat
- not set for Chatfuel
Enhance Your Bot with CodelessBot
CodelessBot plans start from $18/month