question

newuser-90c96f67-1e26-4662-889e-2014a9e87c31 avatar image
newuser-90c96f67-1e26-4662-889e-2014a9e87c31 asked ·

The remote endpoint could not be called, or the response it returned was invalid

Alexa The remote endpoint could not be called, or the response it returned was invalid when using the Alexa trivia kit github as a model

I used the Alexa github trivia kit as a model and changed the questions. Now I am getting the above error and am not sure what the issue could be since I am using lambda as my endpoint.

https://forums.developer.amazon.com/questions/5750/the-remote-endpoint-could-not-be-called-or-the-res.html

alexa skills kitlambdaapp submission and updatesresponse
1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

I'm also not sure what if any files I should be including with this post?

0 Likes 0 ·
Jamie Grossman avatar image
Jamie Grossman answered ·

Please check out an article we have on the matter here. Also, we have a full guide on creating a skill here - might be worth checking out to ensure everything is being done correctly.

10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Fredrik avatar image
Fredrik answered ·

When I got that error, it was always an issue with the questions.js file. Basically, remember that computers are really stupid about syntax.

Make sure that all of your opening brackets are matched up with closing brackets. If you're using something like notepad++ or even OneDrive to edit the file, there is color coding of the code to help you see if you're lining up everything. If one of the lines doesn't look like the rest, there's a problem. Unmatched brackets are underlined.

Another error that I've had is a missing comma. Each of the answers must be separated by a comma. If there's no comma, it fails.

If you're using a ' or a " in your questions or answers, you must have a reverse slash before the character. Otherwise it's wrong.

Here's an example of a question that worked (from my Music History Quiz):

{  
     "What key is the first movement of Vivaldi\'s The Four Seasons?": [
          "E. major",  
          "B. flat minor",  
          "A. major",  
          "C. sharp major"  
    ]
},

The important things are the commas between (but not after) each of the answers, making sure that each answer has a " at the beginning and end, and that there's a \ before the single quote. And don't have a string - the part between the quotes - be on more than one line.

If you've got a lot a questions - I'm over 150 and still building - you will want to test a subset. Use the comment markers (/* at the beginning and */ at the end) to have a bunch of the code ignored. Just remember that you need the beginning and ending brackets to be correct. Start off by including only the first screen's worth of questions, and comment out the rest of the file. If the program runs, move the beginning comment marker down a screen and try again. Once the program crashes, you know what screen the error is on. This means you'll have far less code to look at.

Here's how I commented out a question that just wasn't working correctly:

/* {  
     "What is a three part form, with Section A., generally ending with an open cadence in the dominant or relative minor key, followed by Section B., then concluded by A. prime, the opening material from section A., called?": [
          "Rounded binary form",  
          "Binary form",  
          "Ternary form",  
          "Verse chorus form"  
    ]  
}, */

Everything between the /* and the */ is ignored, so you can comment out a whole bunch of questions. Both notepad++ and OneDrive color comments differently than the rest of the code. That makes the comments easier to see.

(The question is on one line in my code even though it's on several lines here. The problem is that while the code would run, it didn't run correctly. I think; but I'm not positive; that there's a limit to the length of a question. Once I get a complete first draft of questions published, I'm going to go back through index.js and figure out what it's doing. I've got a couple improvements I'd like to make. And if I can get longer questions, I'll do that, to. This is a plan for the summer, at the earliest.)

And to make sure that it IS your questions.js file, try running the code with the Reindeer questions.js file. If it runs with that file but not with yours, it's got to be your file.

Hope this helps.

1 comment
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.