小编Abd*_*fey的帖子

如何在对话框中使用内联编辑器获取外部api数据

我有一个Dialogflow代理,我正在使用它的内联编辑器(由Cloud Functions for Firebase驱动)。当我尝试使用来获取外部api数据时,request-promise-native我会一直进入Ignoring exception from a finished functionFirebase控制台。

function video(agent) {
    agent.add(`You are now being handled by the productivity intent`);
    const url = "https://reqres.in/api/users?page=2";
    return request.get(url)
        .then(jsonBody => {
            var body = JSON.parse(jsonBody);
            agent.add(body.data[0].first_name)
            return Promise.resolve(agent);
        });
}
Run Code Online (Sandbox Code Playgroud)

fulfillment actions-on-google dialogflow-es

0
推荐指数
1
解决办法
1923
查看次数