{"id":2735,"date":"2017-06-10T06:13:10","date_gmt":"2017-06-10T06:13:10","guid":{"rendered":"http:\/\/truelogic.org\/wordpress\/?p=2735"},"modified":"2017-06-10T06:13:10","modified_gmt":"2017-06-10T06:13:10","slug":"2-setting-up-your-google-account-and-api-console","status":"publish","type":"post","link":"https:\/\/truelogic.org\/wordpress\/2017\/06\/10\/2-setting-up-your-google-account-and-api-console\/","title":{"rendered":"2 &#8211; Setting up your Google Account and API Console"},"content":{"rendered":"<p style=\"text-align: center;\"><strong>This is article 2 of the YouTube API With PHP series.<\/strong><\/p>\n<p style=\"text-align: left;\"><strong>\u00a0GOOGLE ACCOUNT<\/strong><\/p>\n<p>Before you can actually start using the YouTube API, you have to register for a Google account. Chances are you already have a google account in the form of a Gmail id. If you use Gmail, then your email id is your Google Account. If you have a YouTube account, that is also your Google Account.<\/p>\n<p>Google Accounts is the single membership control center for all of Google\u2019s services and products. So one google login works for all of them. To manage your Google account, go to <a href=\"http:\/\/accounts.google.com\">http:\/\/accounts.google.com<\/a>.<\/p>\n<p>Here is a screenshot of how it looks:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2737\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1-620x978.png\" alt=\"1\" width=\"620\" height=\"978\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1-620x978.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1-300x473.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1-768x1211.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1-940x1482.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/1.png 1156w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>Your Google account is important because it will be used to access the Google API Console, from where you can enable and activate the YouTube API. The YouTube API is not usable without an API key and that API key is only available if you have a registered Google account.<\/p>\n<p>&nbsp;<\/p>\n<p><strong>GOOGLE API CONSOLE<\/strong><\/p>\n<p>We will now obtain an API Key for use within your code.<\/p>\n<p>1.Go to <a href=\"https:\/\/console.developers.google.com\/\">https:\/\/console.developers.google.com\/<\/a> This is how it looks for me. You might not have the dropdown of applications at the top left corner as I have. Click on the dropdown and click on + icon which shows in the popup as shown in the screenshot below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2738\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-620x468.png\" alt=\"2\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/2.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2739\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-620x474.png\" alt=\"3\" width=\"620\" height=\"474\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-620x474.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-300x229.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-768x587.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-940x719.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/3.png 1156w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>2.Fill in a project name of your choice and click Submit.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2740\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-620x468.png\" alt=\"4\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/4.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>3.Now in the Dashboard page, click on the Enable API button at the top.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2741\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-620x468.png\" alt=\"5\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/5.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>4.This will take you to the Library page which lists all the available Google API services. Locate the APIs for YouTube .<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2743\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-620x468.png\" alt=\"6\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/6.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>5.Click on YouTube Data API. This will bring up the screen below.\u00a0 Click the Enable button at the top.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2744\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-620x468.png\" alt=\"7\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/7.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>6.This brings you back to the Dashboard page with traffic statistics data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2745\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-620x468.png\" alt=\"8\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/8.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>7.Click on the Create Credentials button. This brings the screen below. Choose API Key in the dropdown.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2746\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-620x468.png\" alt=\"9\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/9.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>8.Click Close after that. Do not worry about the Restrict Key option for now. We will come to that later.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2747\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-620x468.png\" alt=\"10\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/10.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>9.This will bring you back to the Dashboard page. Take note of the API key as you will need to use it in your code.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2748\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-620x468.png\" alt=\"11\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/11.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>10.Go back to the dashboard page and again click on Enable API button. Select YouTube Analytics API . Enable it as in the previous steps. Do NOT do the Create Credentials steps . Repeat the same process for YouTube Reporting API. Your dashboard should now look like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2749\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-620x468.png\" alt=\"12\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/12.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>11.Now we will setup OAuth credentials for our web application. Go to the Credentials page , click on Create Credentials button and select OAuth Client id from the dropdown.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2750\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-620x468.png\" alt=\"13\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/13.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>12.On the next page click on the Configure Consent screen button.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2751\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-620x468.png\" alt=\"14\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/14.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>13.Enter a Product name and click on Save<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2752\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-620x468.png\" alt=\"15\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/15.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>14.Now in the Create Client Id page, choose Web Application as the Application type and click Create<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2753\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-620x468.png\" alt=\"16\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/16.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>15.This will generate the Client ID and the Client secret which your code will use when accessing user-authenticated data.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2755\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-620x468.png\" alt=\"17\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/17.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>16.Your Credentials page should look something like this:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2756\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-620x468.png\" alt=\"18\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/18.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>17.One last step remaining is setting the OAuth Redirect URL. This will be explained later in the relevant section, but for now we will just add it in the API Console. Click on the Edit icon next to the OAuth 2.0 client ID item. This will take you to the edit page where you will\u00a0 fill in the value for Authorized Redirect URLs. Most likely you are running your code in a localhost so you can put the url as <u>http:\/\/localhost\/YouTubeapi\/oauthreponse.php<\/u> and click on Save.<\/p>\n<p>This value is what works when running the sample code in this book. But once you are clear on what it actually does, you can change it to whatever url you want. You can enter multiple URLs if required. The explanation for redirect url is in the Coding Patterns section.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignleft size-medium wp-image-2757\" src=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-620x468.png\" alt=\"19\" width=\"620\" height=\"468\" srcset=\"https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-620x468.png 620w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-300x226.png 300w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-768x579.png 768w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-940x709.png 940w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-326x245.png 326w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19-80x60.png 80w, https:\/\/truelogic.org\/wordpress\/wp-content\/uploads\/2017\/06\/19.png 1172w\" sizes=\"auto, (max-width: 620px) 100vw, 620px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>This concludes the activation of the YouTube APIs for your Google account.<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>This is article 2 of the YouTube API With PHP series. \u00a0GOOGLE ACCOUNT Before you can actually start using the YouTube API, you have to <a class=\"mh-excerpt-more\" href=\"https:\/\/truelogic.org\/wordpress\/2017\/06\/10\/2-setting-up-your-google-account-and-api-console\/\" title=\"2 &#8211; Setting up your Google Account and API Console\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":2727,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[318],"tags":[],"class_list":["post-2735","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-youtube-api-with-php"],"_links":{"self":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2735","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/comments?post=2735"}],"version-history":[{"count":3,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2735\/revisions"}],"predecessor-version":[{"id":2758,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/posts\/2735\/revisions\/2758"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media\/2727"}],"wp:attachment":[{"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/media?parent=2735"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/categories?post=2735"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/truelogic.org\/wordpress\/wp-json\/wp\/v2\/tags?post=2735"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}