Skip to content

Instantly share code, notes, and snippets.

@acucciniello
Created October 26, 2016 21:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save acucciniello/034ef879ee541046561220dfac3f0920 to your computer and use it in GitHub Desktop.
Save acucciniello/034ef879ee541046561220dfac3f0920 to your computer and use it in GitHub Desktop.
The remote endpoint could not be called, or the response it returned was invalid. -> Error in Amazon Dev Portal
module.exports = function createFile (test, callback) {
callback(test)
}
var fs = require('fs')
var authorize = require('./google/authorize.js')
var clientSecretsFile = 'client_secret.json'
var createFile = ('./google/createFile.js')
module.exports = CreateFileFunction
function CreateFileFunction (intent, session, response) {
var accessToken = JSON.stringify(session.user.accessToken)
fs.readFile(clientSecretsFile.toString(), function processClientSecrets (err, content) {
if (err) {
console.log('Error Loading client secret file: ' + err)
var secretsError = 'There was an issue reaching the skill'
response.tell(secretsError)
return
} else {
authorize(JSON.parse(content), accessToken, function (err, oauthClient) {
if (err) {
var noOauth = 'We failed getting an oauthClient'
response.tell(noOauth)
return err
}
var test = 'test'
createFile(test, function (name) {
response.tell(name)
})
})
}
})
}
@acucciniello
Copy link
Author

I have tested the CreateFileFunction and it runs successfully (meaning outputs a message to alexa) right after I call the authorize function. Once I call createFile, it seems to throw this error: The remote endpoint could not be called, or the response it returned was invalid. The purpose of creatFile this point is just to take in string test call the callback function and have alexa just respond saying test. Any idea why it is failing on that function?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment