响应 object 无效,这里有什么问题?
Reponse object not working, What is wrong here?
我已经设置了一个 php 应用程序来侦听 alexa 请求并生成响应。测试门户并没有真正给你很多反馈,只是说它不工作。
亚马逊正在发送什么。
{
"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"
}
我的回复是这样的。
{
"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
}
回应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
返回的流需要是具有适当证书的 https 目标。您有一个 http 目的地。
我已经设置了一个 php 应用程序来侦听 alexa 请求并生成响应。测试门户并没有真正给你很多反馈,只是说它不工作。
亚马逊正在发送什么。
{
"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"
}
我的回复是这样的。
{
"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
}
回应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
返回的流需要是具有适当证书的 https 目标。您有一个 http 目的地。