[Alexa] Parse Error on Line 1

[Alexa] Parse Error on Line 1

  
Forge Component
(1)
Published on 2017-06-02 by Cristiana Umbelino
1 vote
Published on 2017-06-02 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.