actions-on-google-nodejs icon indicating copy to clipboard operation
actions-on-google-nodejs copied to clipboard

unable to get webhook params from google actions url

Open rmrbytes opened this issue 6 years ago • 2 comments

I have a google actions project using actionssdk which calls a google function. From the actions webhook url I am passing parameters. For example

https://us-central1-<project-id>.cloudfunctions.net/<function-name>?param1=value1

In the google function using the actionssdk how can I get the param1 value? I tried looking into the contents of conv.body as well as conv.request but did not find them. I tried looking into the framework.express.request.body as well as framework.express.request.headers but did not find the param values.

Can this param value be retrieved? Thanks

rmrbytes avatar Mar 05 '19 14:03 rmrbytes

Hi, since you are using Firebase Functions, you just need to extract out the queries from the request object.

See this Stackoverflow post for more info.

Canain avatar Mar 25 '19 20:03 Canain

Thanks @Canain for the response. I went through the stackoverflow link you referred to. However, if my function is as follows:

...
const app = actionssdk();
...
app.intent('actions.intent.MAIN', ...
...
app.intent('actions.intent.TEXT', ...
...
exports.funcname = functions.https.onRequest(app);

How do I get access to the request object?

rmrbytes avatar Mar 26 '19 10:03 rmrbytes