2017-09-26 40 views
0

我在Azure上託管我自己的服務(HTTPS) - 我已選擇'我的端點是帶有通配符證書的子域'託管我自己的服務(.NET) - 什麼是有效的響應?

我使用Alexa.NET製作響應。

我可以確認的是,模擬器撞擊着我的終點(我做遠程調試,看到斷點被擊中),我知道我的終點返回這個(我試過在郵差)

{ 
    "Version": "1.0", 
    "SessionAttributes": null, 
    "Response": { 
     "OutputSpeech": { 
      "Type": "PlainText", 
      "Text": "test successful" 
     }, 
     "Card": null, 
     "Reprompt": null, 
     "ShouldEndSession": true, 
     "Directives": [] 
    } 
} 

我找不到什麼響應應該看起來像任何文件。我想我可以嘗試用lambda函數創建同樣的事情...

任何人有什麼我可以嘗試任何建議嗎?這整個託管我自己服務的過程中一直很沮喪......

回答

0

這是因爲我的名字的開始一個大寫的樣本響應格式。受詛咒的Javascript串行....

但由於維傑爲指針文件。

在.NET MVC,你這是怎麼做的屬性名小寫:

return JsonConvert.SerializeObject(alexaSkillResponse, new JsonSerializerSettings { 
    ContractResolver = new CamelCasePropertyNamesContractResolver() 
}); 
1

請在這裏找到https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#response-body-syntax

{ 
 
    "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": "Display.RenderTemplate", 
 
     "template": { 
 
      "type": "string" 
 
\t \t ... 
 
     } 
 
     }, 
 
     { 
 
     "type": "AudioPlayer", 
 
     "playBehavior": "string", 
 
     "audioItem": { 
 
      "stream": { 
 
      "token": "string", 
 
      "url": "string", 
 
      "offsetInMilliseconds": 0 
 
      } 
 
     } 
 
     }, 
 
     { 
 
     "general": { 
 
      "type": "VideoApp.Launch", 
 
      "videoItem": { 
 
      "source": "string", 
 
      "metadata": { 
 
       "title": "string", 
 
       "subtitle": "string" 
 
      } 
 
      } 
 
     } 
 
     } 
 
    ], 
 
    "shouldEndSession": boolean 
 
    } 
 
}

相關問題