我已经成功实施了帐户关联,但我没有将任何accessTokens记录到我的履行终点 发送到我的履行终点的json中的AccessToken字段为空。
Array
(
[user] => Array
(
[userId] => 1502895338751
[locale] => en-US
)
[conversation] => Array
(
[conversationId] => 1502895338751
[type] => ACTIVE
[conversationToken] => {"state":null,"data":{}}
)
[inputs] => Array
(
[0] => Array
(
[intent] => actions.intent.TEXT
[rawInputs] => Array
(
[0] => Array
(
[inputType] => KEYBOARD
[query] => talk to APPNAME
)
)
[arguments] => Array
(
[0] => Array
(
[name] => text
[rawText] => talk to APPNAME
[textValue] => talk to APPNAME
)
)
)
)
[surface] => Array
(
[capabilities] => Array
(
[0] => Array
(
[name] => actions.capability.AUDIO_OUTPUT
)
[1] => Array
(
[name] => actions.capability.SCREEN_OUTPUT
)
)
)
[device] => Array
(
)
[isInSandbox] => 1
)
目前还不太清楚要做什么,现在已经坚持了一个多星期。我联系了AOG支持部门,但他们似乎还没有找到我想说的话:/
header('Content-Type: application/json');
$askToken = array (
'conversationToken' => '{"state":null,"data":{}}',
'expectUserResponse' => true,
'expectedInputs' =>
array (
0 =>
array (
'inputPrompt' =>
array (
'initialPrompts' =>
array (
0 =>
array (
'textToSpeech' => 'PLACEHOLDER_FOR_SIGN_IN',
),
),
'noInputPrompts' =>
array (
),
),
'possibleIntents' =>
array (
0 =>
array (
'intent' => 'actions.intent.SIGN_IN',
'inputValueData' =>
(object) array (
),
),
),
),
),
);
echo json_encode($askToken);
exit();
答案 0 :(得分:1)
由于您未使用API.AI,因此您需要在实现其中一个意图时启动帐户关联请求 - 可能是您的欢迎意图。在这种情况下,您需要发回的JSON类似于
{
"conversationToken": "{\"state\":null,\"data\":{}}",
"expectUserResponse": true,
"expectedInputs": [
{
"inputPrompt": {
"initialPrompts": [
{
"textToSpeech": "PLACEHOLDER_FOR_SIGN_IN"
}
],
"noInputPrompts": []
},
"possibleIntents": [
{
"intent": "actions.intent.SIGN_IN",
"inputValueData": {}
}
]
}
]
}