简体   繁体   English

在 Google 助理操作上使用来自网站的 API 响应

[英]Use API Response from a website on a Google Assistant Action

For the context, I'm using public transport everyday.就上下文而言,我每天都在使用公共交通工具。 My city got an app to check the trains/buses and even a public API.我所在的城市有一个应用程序可以检查火车/公共汽车,甚至还有一个公共 API。 With Assistant Snapshot on my phone it tells me at which time I should leave for work, but I don't have precise timetable (especially for buses) and it's only for work.有了手机上的 Assistant Snapshot,它会告诉我应该在什么时间下班,但我没有准确的时间表(尤其是公交车),而且只有上班时间。 At some point Maps used to give me the next buses at my closest station but it's gone (i don't know why)在某些时候,地图曾经在我最近的车站为我提供下一班车,但它不见了(我不知道为什么)

So I decided to build an Assistant Action to ask for the next bus/subway/train for a particular line, and wanted to use their public API for this.所以我决定构建一个 Assistant Action 来请求特定线路的下一个公共汽车/地铁/火车,并希望为此使用他们的公共 API。 The first time ask the user their favorites lines/stations for example.例如,第一次询问用户他们最喜欢的线路/车站。

Is it possible ?是否有可能 ?

Yes, it is possible.对的,这是可能的。 You can start with a conversational action and use a webhook to call their public API and return the results in rich response like a table .您可以从对话操作开始,并使用 webhook 调用他们的公共 API 并以表格等丰富的响应形式返回结果。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM