简体   繁体   中英

Getting Dialogflow webhook path parameters using Actions On Google SDK

Is there a way to retrieve path parameters setted by Dialogflow fulfillment webhook? I'm using Node.js actions-on-google SDK in a Google Cloud Function.

My webhook URL is something like this: https://europe-myexample.cloudfunctions.net/actionHandler/v1

I need to get the v1 param to use it in manageWelcomeIntent function.

const NLGService = require('./services/NLGService.js');
const {dialogflow} = require('actions-on-google');
const app = dialogflow();

exports.actionHandler = app;

app.intent('welcome_intent', NLGService.manageWelcomeIntent);

Can't you eg use const url = require('url'); , or, even simpler, req.url for finding out your server url and then extracting the param?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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