1

我有一个案例,我需要在 Slack 中创建一个 Bot,我的用户可以使用会话语言从我的 Web 应用程序中实时获取信息。场景是这样的:

用户问机器人类似:@hrbot 财务部门有多少员工?

Bot 将字符串发送到 API.AI/diagflow 以解析为 JSON 请求

API.AI 通过 webhook 将 JSON 请求发送到我的 Web App 端点以获取答案

答案返回到用户的 Slack 频道

问题: 1. 如何从 api.ai 获取 auth token 来发送消息给 slack?

4

1 回答 1

0

With Dialogflow (formerly API.AI) you provide a webhook (a HTTPS URL where your server is) and Dialogflow will send a HTTPS request to your webhook when requests come to your Dialogflow agent. You can enable the Slack integration in your Dialogflow agent through the web interface and all requests from Slack will be sent to your Dialogflow agent and (if you configure it) to your webhook with NLU information and the original request from Slack.

Information about the request that is sent to your webhook is documented here: dialogflow.com/docs/fulfillment#request if you respond to the request the response will be forwarded to the user that trigger the request. The response format is documented here: dialogflow.com/docs/fulfillment#response

于 2017-10-25T01:21:36.207 回答