Adonis-ally getting Youtube channel ID / any related info


#1

Hi,

Using adonis-ally can let me have the Google userId and access token
However, how can I get the Youtube info data?

I’m struggling on this

Below is the code that I tried now, but still no message returned

var url = "https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true&key=" + [API_KEY];
console.log(url);

var AuthStr = "Bearer ".concat(authGoogle.getAccessToken());
console.log(AuthStr);


        await axios
            .post(url, {
                headers: {
                    Authorization: AuthStr
                }
            })
            .then(function(message) {
                console.log(message);
            })
            .catch(function(error) {
                console.log('logging error: ');
                console.log(error);
            });

Am I doing this right? Thanks