1
我已經設置了一個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
}
響應頭
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
音頻流也需要安全嗎? – ahackney
是的。爲了快速測試,找到合適的在線文件並使用該URL。 –
我試着在服務器上放一個mp3並在本地播放。只需將網址與網址的直接鏈接替換即可,並且也失敗了。我可以做我的服務器有問題嗎?它在一個使用letsencrypt ssl的服務器上。 – ahackney