Actions on google 未在模拟器上接收AccessToken
我的完成终点不是接收accessToken。这正常吗? 因为当im在模拟器上时,它不会真正要求登录到我的授权端点,因此,它不会获得访问令牌。我的Oauth在与Oauth游乐场测试后工作正常 action.json 完成收到的请求 请求已记录到文本文件中Actions on google 未在模拟器上接收AccessToken,actions-on-google,google-home,google-smart-home,Actions On Google,Google Home,Google Smart Home,我的完成终点不是接收accessToken。这正常吗? 因为当im在模拟器上时,它不会真正要求登录到我的授权端点,因此,它不会获得访问令牌。我的Oauth在与Oauth游乐场测试后工作正常 action.json 完成收到的请求 请求已记录到文本文件中 jsondata = file_get_contents('php://input'); $postdata = json_decode($jsondata, true); $RAWfile = print_r($postdata, true)
jsondata = file_get_contents('php://input');
$postdata = json_decode($jsondata, true);
$RAWfile = print_r($postdata, true);
file_put_contents('RAWfile.txt', $RAWfile);
RAWfile.txt
模拟器请求
模拟器响应
帐户链接通过位于的操作控制台完成 从“概述”菜单项,您需要进入第5步:帐户链接
在那里,您可以设置您的端点、所需的作用域等。您认为必须手动完成该部分-如果您查看响应,您将看到一个URL-复制/粘贴并运行该URL,它应该完成帐户链接过程-
“在日志区域,从debugInfo.sharedDebugInfo.debugInfo字段复制URL并粘贴到web浏览器中。您将被重定向到API.AI或操作控制台中指定的自己服务器的身份验证URL。”I更新了必要的信息,但是动作模拟器没有使用它:/I我发布了模拟器请求/响应,但我看不见和URL。首先,我去检查了我的,以进行比较,发现了相同的问题。出去,回去,然后重新测试,我得到了调试信息,所以看起来是随机的,嗯,没有办法报告错误。因为我根本看不到网址。已尝试10次以上:3次
jsondata = file_get_contents('php://input');
$postdata = json_decode($jsondata, true);
$RAWfile = print_r($postdata, true);
file_put_contents('RAWfile.txt', $RAWfile);
Array
(
[user] => Array
(
[userId] => APhe68HH0PP0nTYnY8jBJed31WqF
[locale] => en-US
)
[conversation] => Array
(
[conversationId] => 1500924702161
[type] => NEW
)
[inputs] => Array
(
[0] => Array
(
[intent] => actions.intent.MAIN
[rawInputs] => Array
(
[0] => Array
(
[inputType] => VOICE
[query] => ask APP NAME to bla bla
)
)
[arguments] => Array
(
[0] => Array
(
[name] => trigger_query
[rawText] => bla bla
[textValue] => bla bla
)
)
)
)
[surface] => Array
(
[capabilities] => Array
(
[0] => Array
(
[name] => actions.capability.AUDIO_OUTPUT
)
)
)
[device] => Array
(
)
[isInSandbox] => 1
)
{
"query": "bla bla",
"accessToken": "ya29.Gl2TBLrbKjcgK-6jsARmc4Zvkx8qT2X2rE3vsuwEVc_Ey2-q4OUqNWaJPBlXzIjONb_u2MbrE-rgnfwQSZpbZReXsmZjoGOy18Tvp7xzzSJb-cW9SjZ32uLBaKO7vGE",
"expectUserResponse": true,
"conversationToken": "CiZDIzU5O...",
"surface": "GOOGLE_HOME",
"inputType": "VOICE",
"locale": "en-US",
"location": {
"address": "Googleplex, Mountain View, CA, United States",
"position": {
"lat": 37.421980615353675,
"lng": -122.08419799804688
},
"zipCode": "94043",
"city": "Mountain View"
},
"debugInfo": {
"assistantToAgentDebug": {
"assistantToAgentJson": {
"user": {
"userId": "bla",
"locale": "en-US"
},
"conversation": {
"conversationId": "1501004260313",
"type": "NEW"
},
"inputs": [
{
"intent": "actions.intent.MAIN",
"rawInputs": [
{
"inputType": "VOICE",
"query": "bla"
}
],
"arguments": [
{
"name": "trigger_query",
"rawText": "bla",
"textValue": "bla"
}
]
}
],
"surface": {
"capabilities": [
{
"name": "actions.capability.AUDIO_OUTPUT"
}
]
},
"device": {},
"isInSandbox": true
}
}
}
}
{
"response": "Sure. Here's the test version of bla.\nsure\n",
"conversationToken": "bla",
"audioResponse": "//NExAASS...",
"debugInfo": {
"agentToAssistantDebug": {
"agentToAssistantJson": {
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": false,
"finalResponse": {
"richResponse": {
"items": [
{
"simpleResponse": {
"textToSpeech": "sure",
"displayText": "sure"
}
}
],
"suggestions": []
}
}
}
}
}
}