Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to pull Data from Youtube CMS using Google AppScipt
    primarykey
    data
    text
    <p>I am trying to use the YouTube API to pull in data from you CMS account using Google AppScript.</p> <p>I can successfully get a token using OAuth2 and I believe I have the proper scopes but I am still getting a 401 error when I try to populate my google spreadsheet with the video ID from the ISRC number.</p> <p>I made the following changes to the OAuth2 piece to include the proper scope for Youtube CMS according to the youtube partner developer's guide to OAuth2.</p> <pre><code>AUTHORIZE_URL = 'https://accounts.google.com/o/oauth2/auth'; //step 1. we can actually start directly here if that is necessary var TOKEN_URL = 'https://accounts.google.com/o/oauth2/token'; //step 2. after we get the callback, go get token var CLIENT_ID = 'MyClientId'; var CLIENT_SECRET = 'MyClientSecret'; var REDIRECT_URL= ScriptApp.getService().getUrl(); var tokenPropertyName = 'GOOGLE_OAUTH_TOKEN'; var baseURLPropertyName = 'GOOGLE_INSTANCE_URL';`enter code here` function getURLForAuthorization(){ return AUTHORIZE_URL + '?response_type=code&amp;client_id='+CLIENT_ID+'&amp;redirect_uri='+REDIRECT_URL + '&amp;scope=https://www.googleapis.com/auth/youtubepartner'+'&amp;access_type=offline'; //added access type from above api guide } </code></pre> <p>But I am still receiving an error here:</p> <p>Request failed for <a href="https://www.googleapis.com/youtube/partner/v1/assetSearch?q=USY6C0700704&amp;key=MyAPIKey_simple" rel="nofollow">https://www.googleapis.com/youtube/partner/v1/assetSearch?q=USY6C0700704&amp;key=MyAPIKey_simple</a> returned code 401</p> <p>The requests looks the same as what I am doing in the API Explorer:</p> <p>GET <a href="https://www.googleapis.com/youtube/partner/v1/assetSearch?q=USY6C0700704&amp;key=" rel="nofollow">https://www.googleapis.com/youtube/partner/v1/assetSearch?q=USY6C0700704&amp;key=</a>{YOUR_API_KEY}</p> <p>So the only think what may be wrong is a problem with my token.</p> <p>Any help would be greatly appreciated thanks guys.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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