更新: 你的網絡掛接響應需要包括以下形式的JSON對象請求的權限:
。
{
"speech": "...", // ASCII characters only
"displayText": "...",
"data": {
"google": {
"expect_user_response": true,
"is_ssml": true,
"permissions_request": {
"opt_context": "...",
"permissions": [
"NAME",
"DEVICE_COARSE_LOCATION",
"DEVICE_PRECISE_LOCATION"
]
}
}
},
"contextOut": [...],
}
目前唯一可用的權限是NAME,DEVICE_PRECISE_LOCATION和DEVICE_COARSE_LOCATION這是記錄在這裏:https://developers.google.com/actions/reference/webhook-format#response
以前的答案:
您可以在developer reference(轉載如下)中找到JSON佈局,但Node.js client library使這更容易,看起來像您可以install npm modules on Lambda。
{
"user": {
"user_id": "...",
"profile": {
"given_name": "John",
"family_name": "Doe",
"display_name": "John Doe"
},
"access_token": "..."
},
"device": {
"location": {
"coordinates": {
"latitude": 123.456,
"longitude": -123.456
},
"formatted_address": "1234 Random Road, Anytown, CA 12345, United States",
"city": "Anytown",
"zip_code": "12345"
}
},
"conversation": {
"conversation_id": "...",
"type": "ACTIVE",
"conversation_token": "..."
},
"inputs": [
{
"intent": "assistant.intent.action.MAIN",
"raw_inputs": [
{
"query": "..."
}
],
"arguments": [
{
"name": "destination",
"raw_text": "SFO",
"location_value": {
"latlng": {
"latitude": 37.620565,
"longitude": -122.384964
},
"formatted_address": "1000 Broadway, San Francisco, CA 95133"
}
}
]
}
]
}
你能解釋一下「帳戶鏈接」是什麼意思嗎?您是否有興趣要求用戶獲得他們的名字或位置的許可?或與其他一些API連接? – matthewayne
我對授予我權限的用戶感興趣,以便接收他們用來登錄Google Home的電子郵件地址。這會讓我發送一個摘要電子郵件給用戶。 –
現在,您只能通過Google上的操作獲取位置信息和用戶名:https://developers.google.com/actions/develop/identity/user-info – matthewayne