0
votes

I have two Youtube channels (A & B), each with a different Google account. Then, I have a third Google account (C) with all my Google Apps Script files in Drive. I want to write a script in account C to retrieve data with a Google Apps Script from the Youtube channels using the Youtube Analytics API provided in Google Script. But, using the example given here (https://developers.google.com/apps-script/advanced/youtube-analytics?hl=es) I can only access the channel of my current account. Since what I want is to retrieve data from channels set in accounts A and B from Drive set in account C, it obviously fails.

I guess the solution would be to use something related to OAuth 2 but I don't really know how to start. So, if there's a explicit solution or you could give me some tips, I'd be most grateful.

Thank you for your time!

1

1 Answers

0
votes

Here the options I can propose you:

  • if you can use some spreadsheet, you could build a script in each account that get the data for is own account and append it to a spreadsheet owned by account C with write right for A&B.
  • if your informations are not too sensitive you can build a script in account A & B that can be triggered anonimously and in the account C build an other script that fetch the data from the scripts A&B.
  • The really non easy solution will be to use oauth2 authentified request from the script in account C to retrieve the data from A & B, but that's tough google apps script.