$.uaYT = function() { this.getList_Channels = function(pCbkFunc) { let pAccess; try { (async () => { pAccess = await pInterface.getToken(PLATFORM_GOOGLE); $.ajax({ url: 'https://www.googleapis.com/youtube/v3/channels', method: 'GET', headers: { Authorization: `Bearer ${pAccess.access}`//pInterface.getToken(PLATFROM_GOOGLE).access }, data: { part: 'snippet,contentDetails,statistics', // Request relevant parts mine: true // Retrieve the channel for the authenticated user }, success: function(pResp) { let pData = []; $.each(pResp.items,function() { pData.push({ label: this.snippet.title, id: this.id }); }); pCbkFunc({ bError: false, data: pData }); }, error: function(jqXHR, textStatus, errorThrown) {//no channels pCbkFunc({ bError: true, idMsg: 200 }); } }); })(); } catch(ex) { } }; this.getList_Videos = function(pCbkFunc) { } ; this.get_Video = function(pData, pCbkFunc) { }; this.insert_Video = function(pData,pCbkFunc) { }; this.update_Video = function(pData,pCbkFunc) { }; this.delete_Video = function(pData,pCbkFunc) { }; return this; };