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!