获取亚马逊回声的唯一设备ID

Sam*_*m M 3 alexa-skill alexa-skills-kit amazon-echo alexa-voice-service

我正在为亚马逊回声编写自定义技能,我需要获得一个唯一的设备ID,以便我可以将产品注册到我的服务中.我读到的一切都说你无法从设备中获取id.亚马逊改变了吗?是否有工作来获取设备ID?

mda*_*ddy 6

本周,亚马逊在Alexa Skills的LaunchRequest JSON有效载荷中添加了设备ID(唯一).

{
  "session": {
    "new": true,
    "sessionId": "string",
    "application": {
      "applicationId": "string"
    },
  },
  "context": {
      "device": {
        "deviceId": "string",     
      },
  "request": {}
}  
Run Code Online (Sandbox Code Playgroud)

您可以使用context-> device-> deviceId字符串来唯一标识请求所来自的设备.

阅读更多内容@ https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/docs/alexa-skills-kit-interface-reference#request-body-syntax