I'm trying to call the youtube API to make a playlist on my channel from a chrome extension and I keep getting this error code returned back to me;
domain: "youtube.parameter"location: "parameters."locationType: "other"message: "No filter selected. Expected one of: channelId, id, mine"reason: "missingRequiredParameter"this is my manifest file:
"action": {"default_title": "multi monitor for youtube" },"oauth2": {"client_id": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx","scopes": ["https://www.googleapis.com/auth/youtube.force-ssl","https://www.googleapis.com/auth/youtubepartner","https://www.googleapis.com/auth/youtube" ] },"permissions": ["identity" ],"host_permissions": ["https://www.googleapis.com/"],"background": {"service_worker": "background.js" },"manifest_version": 3and this is my background file
chrome.action.onClicked.addListener(function(){ chrome.identity.getAuthToken({ interactive: true }, function (token) { console.log(token); let fetch_options = { //method: 'POST', headers: { Authorization: `Bearer ${token}`,'Content-Type': 'application/json', },"part": ["snippet,status" ],"resource": {"snippet": {"title": "Sample playlist created via API","channelId": "UC0E5pDp_c2riLV4UhEgynKA","description": "This is a sample playlist description.","tags": ["sample playlist","API call" ],"defaultLanguage": "en" },"status": {"privacyStatus": "private" }, } }; fetch('https://www.googleapis.com/youtube/v3/playlists', fetch_options ) .then((response) => response.json()) // Transform the data into json .then(function (data) { console.log(data);//contains the response of the created event }); });});I tried to use the second answer from this question but there are some changes that had to be made in order to call the youtube API instead of the calendar.Because I was getting the error I tried adding the channel ID to the snippet and it still doesn't work.I'm very new to creating chrome extensions so please forgive me if there is an obvious mistake here.