Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Try OAuth 2.0 for installed application: <a href="http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#OAuth2_Installed_Applications_Flow" rel="noreferrer">http://code.google.com/apis/youtube/2.0/developers_guide_protocol.html#OAuth2_Installed_Applications_Flow</a></p> <p>First, register the API to get a client_id. </p> <p>Then, log into your google account, type the following URL, change the client_id with yours. redirect_uri should be set to "urn:ietf:wg:oauth:2.0:oob".</p> <p><a href="https://accounts.google.com/o/oauth2/auth?client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com&amp;redirect_uri=urn:ietf:wg:oauth:2.0:oob&amp;scope=https://gdata.youtube.com&amp;response_type=code&amp;access_type=offline" rel="noreferrer">https://accounts.google.com/o/oauth2/auth?client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com&amp;redirect_uri=urn:ietf:wg:oauth:2.0:oob&amp;scope=https://gdata.youtube.com&amp;response_type=code&amp;access_type=offline</a></p> <p>Then you authorize your own application and get an authorization code.</p> <p>Then open a terminal and type (change your code, client_id, and client_secret): </p> <pre><code>curl https://accounts.google.com/o/oauth2/token -d "code=4/ux5gNj-_mIu4DOD_gNZdjX9EtOFf&amp;client_id=1084945748469-eg34imk572gdhu83gj5p0an9fut6urp5.apps.googleusercontent.com&amp;client_secret=hDBmMRhz7eJRsM9Z2q1oFBSe&amp;redirect_uri=urn:ietf:wg:oauth:2.0:oob&amp;grant_type=authorization_code" </code></pre> <p>You will get response like:</p> <p><code>{ "access_token" : "ya29.AHES6ZTtm7SuokEB-RGtbBty9IIlNiP9-eNMMQKtXdMP3sfjL1Fc", "token_type" : "Bearer", "expires_in" : 3600, "refresh_token" : "1/HKSmLFXzqP0leUihZp2xUt3-5wkU7Gmu2Os_eBnzw74" }</code></p> <p>Remember the refresh_token, and every time you run your application, you need to get a new access_token with the refresh_token. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload