使用Lambda的Dialogflow-Webhook调用失败。错误:502错误的网关

时间:2019-11-03 15:05:14

标签: node.js aws-lambda dialogflow dialogflow-fulfillment

我正在使用aws lambda通过API网关响应Dialogflow Webhook。我已经使用基本身份验证在实现中添加了Webhook。成功调用了lambda(基于Cloudfront日志),并返回了一个fillmentment_text响应;

exports.handler = async (event, context) => {
    return { fulfillmentText: 'IT WORKS' };
};

由于某种原因,我总是得到:

API响应

  "webhookStatus": {
    "code": 13,
    "message": "Webhook call failed. Error: 502 Bad Gateway."
  }

Dialogflow documentation

1 个答案:

答案 0 :(得分:0)

我可以不用快递了。我希望这有帮助。

{
    const { dialogflow,SimpleResponse,BasicCard,Image,Suggestions,MediaObject,SignIn,Permission } = require('actions-on-google');

    const app = dialogflow({debug:true, clientId: process.env.dialogFlowClientID});

    app.intent('Default Welcome Intent', (conv) => {
        conv.ask('You made it you rock star');
    });


    exports.lambdaHandler = app
}
相关问题