CMS (private Spreadsheet): Missing a valid API key


#1

Hey there,

as mentioned in the title a get an error when using a private google spreadsheet as a cms. However this error only appears when using an http(s) endpoint (aws lambda). When I deploy the exact same code using the jovo debugger as the endpoint, everything works (so I don’t get an error of a not valid api key).

There error is the following:

Msg: The request is missing a valid API key.

Stack: Error: The request is missing a valid API key.
at GoogleSheetsCMS.retrieveSpreadsheetData (/var/task/node_modules/jovo-cms-googlesheets/dist/src/GoogleSheetsCMS.js:103:19)
at process._tickCallback (internal/process/next_tick.js:68:7)

Module: jovo-cms-googlesheets

I followed the docu and asuming everything works with the jovo debugger my setup/ config was right?

The problem is, that setting the spreadsheet to public gives me the same problem that already appread to me: See github

Message: HTTP Response code 302

Stack: Error: HTTP Response code 302
at IncomingMessage.res.on (/var/task/node_modules/jovo-cms-googlesheets/dist/src/GoogleSheetsCMS.js:154:43)
at IncomingMessage.emit (events.js:203:15)
at process._tickCallback (internal/process/next_tick.js:63:19)

Module: jovo-cms-spreadsheets
Hint: This might occur when you try to access a private spreadsheet without the permission.


#2

I assume it’s a problem with the bundle.

How do you bundle the code for Lambda?


#3

I’m deploying to lambda. To get it working with google assistant i use and AWS API Gateway.

Here are my deploy settings (ofc without ids and arns):

module.exports = {
  defaultStage: 'local',
  stages: {
    local: {
      alexaSkill: {
        manifest: {
          apis: {
            custom: {
              interfaces: [{
                type: 'ALEXA_PRESENTATION_APL'
              }]
            }
          }
        },
        nlu: 'alexa',
        skillId: '',
        endpoint: '${JOVO_WEBHOOK_URL}'
      },
      googleAction: {
        nlu: 'dialogflow',
        dialogflow: {
          endpoint: '${JOVO_WEBHOOK_URL}',
          projectId: '',
          keyFile: './Google Key File/keyfile.json',
        },
      },
    },
    prod: {
      host: {
        lambda: {
          arn: '',
          askProfile: 'default'
        }
      },
      alexaSkill: {
        manifest: {
          apis: {
            custom: {
              interfaces: [{
                type: 'ALEXA_PRESENTATION_APL'
              }]
            }
          }
        },
        nlu: 'alexa',
        skillId: '',
      },
      googleAction: {
        nlu: 'dialogflow',
        dialogflow: {
          endpoint: '',
          projectId: '',
          keyFile: './Google Key File/keyfile.json',
        },
      },
    },
  }
};