[Alexa] Parse Error on Line 1

Forge Component
(2)
Published on 29 May by Cristiana Umbelino
2 votes
Published on 29 May by Cristiana Umbelino

I am getting an error message in Service Simulator (Amazon Developer Console)


"Parse Error on Line 1
The response is invalid

^

Expecting 'STRING', 'NUMBER', 'NULL','TRUE','FALSE','{','[', got

undefined"


for the input 



"{

  "session": {

    "new": true,

    "sessionId": "SessionId.d93a61d9-35f7-4ad5-874f-f5f53fbdae40",

    "application": {

      "applicationId": "amzn1.ask.skill.9cbc5f6e-868c-4d19-87ef-1613b4eed06f"

    },

    "attributes": {},

    "user": {

      "userId": "amzn1.ask.account.AGP5ZRAHVB42MUSKCMNS45XKEXTGT6HGZYHLZ62GFF66BHDF35YZUUIQAGBEAWH266DXQCI6C7FOSMFOLYJZFLZGYTULRUC2DEXLQYM2HBA6DAQI7RNUTWT2UGNUF62BWPCZW3UDM2JQFRH2JNZ4VFWBPFKJT3EU2E67HHIDGN7VYBVZPGO7QKADEGI6O33VDF6A26YHCU34G6Y"

    }

  },

  "request": {

    "type": "IntentRequest",

    "requestId": "EdwRequestId.50f3e1c8-5f5a-43cd-a9a1-310567ad26c4",

    "intent": {

      "name": "GetErrorReport",

      "slots": {}

    },

    "locale": "en-IN",

    "timestamp": "2018-03-07T06:38:13Z"

  },

  "context": {

    "AudioPlayer": {

      "playerActivity": "IDLE"

    },

    "System": {

      "application": {

        "applicationId": "amzn1.ask.skill.9cbc5f6e-868c-4d19-87ef-1613b4eed06f"

      },

      "user": {

        "userId": "amzn1.ask.account.AGP5ZRAHVB42MUSKCMNS45XKEXTGT6HGZYHLZ62GFF66BHDF35YZUUIQAGBEAWH266DXQCI6C7FOSMFOLYJZFLZGYTULRUC2DEXLQYM2HBA6DAQI7RNUTWT2UGNUF62BWPCZW3UDM2JQFRH2JNZ4VFWBPFKJT3EU2E67HHIDGN7VYBVZPGO7QKADEGI6O33VDF6A26YHCU34G6Y"

      },

      "device": {

        "supportedInterfaces": {}

      }

    }

  },

  "version": "1.0"

}"


I am getting an output JSON as below in Postman  when I test the endpoint

"{"version":"1.0","response":{"outputSpeech":{"type":"PlainText","text":"Everything's fine, enjoy your morning."},"card":{"type":"Simple","title":"GetErrorReport","content":"Everything's fine, enjoy your morning."}}}"


Please let me know how to get this working.

Hi Siya,

Did you check what is actually sent to Amazon by the REST service? See here for a quick guide.

Also, it seems that Amazon expects something that isn't there; is it possible you do not send the default value for an attribute that is mandatory for Amazon?

Hello Kilian,

Thank you for the quick reply. It is observed that from the Service Simulator my skill over the "Text" Mode but not in JSON.

Hi Syia, thank you for downloading and using the component. I'm really sorry to left this thread hanging.

I've updated the component and tested it using the Alexa Developer Console.


Please have in mind that this is an how-to for a specific use case and some code, like structures, will need to be changed.


I'll be updating the documentation and if possible implement more features in the upcoming weeks.