【发布时间】:2016-09-22 14:20:22
【问题描述】:
我正在开发一个 Web 服务,用于处理 Alexa 发送的请求,并在 .net 框架中以特定响应进行响应。 Alexa 以 JSON 格式向您的服务发送的请求正文,如下所示:
{
"version": "string",
"session": {
"new": true,
"sessionId": "string",
"application": {
"applicationId": "string"
},
"attributes": {
"string": {}
},
"user": {
"userId": "string",
"accessToken": "string"
}
},
"context": {
"System": {
"application": {
"applicationId": "string"
},
"user": {
"userId": "string",
"accessToken": "string"
},
"device": {
"supportedInterfaces": {
"AudioPlayer": {}
}
}
},
"AudioPlayer": {
"token": "string",
"offsetInMilliseconds": 0,
"playerActivity": "string"
}
},
"request": {}
}
和响应正文语法在下面的Json格式:
{
"version": "string",
"sessionAttributes": {
"string": object
},
"response": {
"outputSpeech": {
"type": "string",
"text": "string",
"ssml": "string"
},
"card": {
"type": "string",
"title": "string",
"content": "string",
"text": "string",
"image": {
"smallImageUrl": "string",
"largeImageUrl": "string"
}
},
"reprompt": {
"outputSpeech": {
"type": "string",
"text": "string",
"ssml": "string"
}
},
"directives": [
{
"type": "string",
"playBehavior": "string",
"audioItem": {
"stream": {
"token": "string",
"url": "string",
"offsetInMilliseconds": 0
}
}
}
],
"shouldEndSession": boolean
}
}
我在亚马逊开发者论坛Hosting a Custom Skill as a Web Service,Handling Requests Sent by Alexa上进行了研究,但我无法实现这件事,而且我没有使用 Lambda 功能,我想制作一个自定义技能和我的位置不在美国北部。
我得到了 Lib。来自 github here 并在我的网络服务中使用,但无法与此库同步,这里的任何人都可以给我一个方向,我该怎么做,或者我该如何开始提前谢谢。
【问题讨论】:
标签: c# json web-services alexa alexa-skills-kit