Google Sheet API : “message”: “The request is missing a valid API key.”

I’m trying to make an extencion that will take some data from page and send it to google sheet.
My manifest:

"oauth2": {
        "client_id": "client_id",
        "scopes": [""] 
    "permissions": [
    "key": {key}

background page:

var tokenS;
chrome.runtime.onInstalled.addListener(function() {{number: value}, function(data) {
        interactive: false
    }, function(token) { 
        tokenS = token
function writeData(request, sender){
    myspreadsheetId = "myspreadsheetId " 
    var params = {
        "majorDimension": "ROWS",
        "values": [
    var xhr = new XMLHttpRequest();'PUT', '' + myspreadsheetId + '/values/Sheet1!A1:A1?valueInputOption=USER_ENTERED');
    xhr.setRequestHeader('Authorization', 'Bearer '+tokenS);

I receive next error:

  "error": {
    "code": 403,
    "message": "The request is missing a valid API key.",
    "status": "PERMISSION_DENIED"

at google cloud platform I see a 100% error ratio ( And I do not understand what I’m doing wrong. Pleasse help.

How to use Twitter API in chrome extension to get cryptocurrency data?

I would like to create a chrome extension that can get twitter feed (about bitcoin or any cryptocurrency data) and add all the data in the a google sheet.

Google Sheets API and Chrome Apps

I have an app that’s pulling data from Google Sheets with background.js but I am unable to use that information in the popup.js itself. I am not too familiar with Chrome Apps, what can I do in this case? How do I get Chrome Identity or the API to pass the information to popup.js? I can’t implement the API call in popup.js because I need it to work in the background.

So I want to modify a sheet with the Google Sheets API and then read off it.

I am basically doing this in the background.js:

chrome.identity.getAuthToken({ 'interactive': true }, function(token) {
    var response;
    var requestURL = "" + spreadsheetId + "/values/" + range;
    var objectHTTP;
    objectHTTP = new XMLHttpRequest();
    objectHTTP.onreadystatechange = function() {

    if (objectHTTP.readyState == 4 && objectHTTP.status == 200) {
            response = objectHTTP.responseText;
    };"GET", requestURL, false);
    objectHTTP.setRequestHeader('Authorization', 'Bearer ' + token);

    // This is the part where I obtain the response, but how do I use it in the main app (popup.js)? Can I somehow share the variables?

Google slides auto update links /tables linked from google sheet

I have a google slides presentation that has some linked cells/table from google sheets. Currently, I have to manually click each linked cell/table to update values.
I need apps script for google slides that would auto update / batchupdate / refresh links, so that the values/tables get auto update. Is that possible?

Chrome extension content security policy violated while trying Google Sheets API call

I am making my first chrome extension. My idea is to call Google Sheets API to append a row in a google spreadsheet from my extension. I am referring this link for the same and successfully tried the API to append row in my desired sheet.

Now I am trying to do the same from my chrome extension. But the below line throws error:


The error is at src="". Error message is:

Refused to execute inline event handler because it violates the
following Content Security Policy directive: “script-src ‘self’“. Either the ‘unsafe-inline’
keyword, a hash (‘sha256-…’), or a nonce (‘nonce-…’) is required
to enable inline execution.

For this, I tried adding following lines in my manifest.json file:

"permissions": ["activeTab", "storage", ""],
"content_security_policy": "script-src 'self'; object-src 'self'"

Still I am getting the error message highlighted above. I tried using unsafe-inline as well but chrome browser is ignoring it.

Any ideas what am I missing?

Many thanks in advance.

Closed the chrome add on but the process still runs and doesnt terminate how to fix this?

Am currently working on developing a chrome addon.. when i click the close button in the sidebar the addon gets closed but the process doesnt terminate and keeps running how to fix this?