我想从 Webhook 重定向到另一个流程中的页面。例如,当页面调用 Webhook 时,Webhook 可以重定向到不同流程中的页面。
res["target_page"] = "projects/[id project]/locations/[id location]/agents/329b4fd2-6273-41b3-a113-ab2d53ae923b/flows/ead52edd-e7c2-46c8-af31-6c7b1e7c6678/pages/c563fc10-7058-4ae8-842e-d439560bdbe5"
当 webhook 被触发时,我收到了这个奇怪的错误:
看起来,当我选择一个页面时,即使我将流程 ID 指定为“ead52edd-e7c2-46c8-af31-6c7b1e7c6678”,它也会默认为主流程。我尝试输入不同的值,但它仍然考虑默认流“00000000-0000-0000-0000-000000000000”。
这是一个错误吗?我怎样才能正确指定流程?
在webhookResponse中,您可以设置fulfillment_response和target_page字段以分别发送履行响应以及转换到另一个页面。下面是一个例子:
{
targetPage: projects/<Project ID>/locations/<Location ID>/agents/<Agent ID>/flows/<Flow ID>/pages/<Page ID>,
fulfillmentResponse: {
messages: [{
text: [“Text response from webhook”],
}]
}
}
这是结果示例:
重要提示:如果它位于不同的流程中,则必须指定属性
targetFlow
,您可以使用 targetFlow
或 targetPage
,但不能同时使用两者:https://cloud.google。 com/dialogflow/cx/docs/reference/rest/v3/TransitionRoute
当您转换到流程时,它从起始页面开始!