I am trying to do two things using “Google Apps Script” with YouTube;

(a) Case I
 - Requirement : For each of my Playlists, get Playlist details to a
 Google Sheet
 - Method : used code as below with **“PlaylistItems:
 list”** method Added MY PLAYLIST ID using an array (Playlist IDs added
 manually to the Array).

```
 var cur_pl      = YouTube.PlaylistItems.list("snippet,contentDetails", {"maxResults": 50,"playlistId":MY PLAYLIST ID }) ;
    var modRes1 = cur_pl.items.map(function(v) {return [v.snippet.title,,v.snippet.position, v.etag];});
    Logger.log(modRes5);

```

* Result : Worked as expected for all my “Public” playlists.

(b) Case II
 - Requirement : Get a list of all of my Playlists to a Google Sheet
 - Method : used code as below using a similar concept to above (a) with **“Playlists: list”** Method.

```
var my_pl    = YouTube.Playlists.list("snippet,contentDetails",{"maxResults": 50,"mine": true })
var modRes2  = my_pl.items.map(function(v) {return [v.snippet.title,v.snippet.channelId]});
Logger.log(modRes2);

```

* Result : Not worked and throws this error

> 
> GoogleJsonResponseException: API call to youtube.playlists.list failed
>  with error: Channel not found. (line 9, file ")
> 
> 
> 

I tried both cases with “Try this API” at following and worked as expected :  

 - <https://developers.google.com/youtube/v3/docs/playlists/list>
 - <https://developers.google.com/youtube/v3/docs/playlistItems/list>

I think for the (case II), I may be missing authorization of my API request inside my Apps Script? Probably using API-Key or Auth2.0? 
(when I tried with “[Try this API][1]” I noted in code example they have authorization steps.

**Question: How to add the Authorization (auth2 or API-Key) step into the script?**

Appreciate help