我正在使用IBM Watson Assistant创建一个机器人。我正在尝试使用Webhook,但不知道发送到Webhook的POST请求JSON / HTML的格式。
我的案例研究是一家商店,用户可以在此进行预订。我想将订单详细信息发送到我的后端服务器,并为用户提供预购的编号。我在文档中没有发现有关从IBM Watson Assistant发送什么POST请求格式以及应该以哪种格式返回响应的文档。
我知道IBM Watson Assistant不需要特定的响应格式。它允许开发人员根据需要来操纵响应。
IBM Watson Assistant具有documented API。有推荐的V2 Assistant API,可用于创建会话然后发送消息。较旧的V1 Assistant API具有更多功能,并且更深入系统。两种API均可用于编写聊天机器人。
如果您是指从对话框节点延伸到外部服务的Webhook as the Watson Assistant功能,则过程如下:
此IBM Cloud Solution tutorial on building a Slack bot with Watson Assistant使用webhook调出Db2数据库。该代码可在GitHub存储库中找到。