dougutuo9879
dougutuo9879
2017-02-22 21:42

响应对象无法正常工作,这里有什么问题?

已采纳

I've setup a php app that listens for the alexa request and generates the response. The testing portal doesn't really give you a lot of feedback, just that it's not working.

What amazon is sending.

{
"session": {
    "sessionId": "SessionId.here",
    "application": {
        "applicationId": "amzn1.ask.skill.here"
    },
    "attributes": {},
    "user": {
      "userId": "amzn1.ask.account.here"
    },
    "new": true
    },
    "request": {
        "type": "IntentRequest",
        "requestId": "EdwRequestId.here",
        "locale": "en-US",
        "timestamp": "2017-02-22T21:33:26Z",
        "intent": {
          "name": "PlayTheStream",
          "slots": {}
        }
    },
    "version": "1.0"
}

My response is this.

{
  "version": "1.0",
  "response": {
    "outputSpeech": {
      "type": "PlainText",
      "text": "Now streaming this stream"
    },
    "card": {
      "type": "Simple",
      "title": "Play Audio",
      "content": "Playing the requested stream."
    },
    "directives": {
      "type": "AudioPlayer.Play",
      "playBehavior": "ENQUEUE",
      "audioItem": {
        "stream": {
          "token": "this-is-the-audio-token",
          "url": "http://functionalstream.com/playlist.m3u",
          "offsetInMilliseconds": 0
        }
      }
    }
  },
  "shouldEndSession": true
}

Response headers

cache-control →no-cache, private
content-type →application/json
date →Wed, 22 Feb 2017 21:33:10 GMT
server →nginx/1.11.2
status →200
x-content-type-options →nosniff
x-frame-options →SAMEORIGIN
x-xss-protection →1; mode=block
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

1条回答

  • dq13733519262 dq13733519262 4年前

    Returned stream needs to be an https target with a proper certificate. You have a http destination.

    点赞 评论 复制链接分享

相关推荐