json body depending on where they are extracted from.
1. If the parameters are extracted as
Intent parameters, you can retrieve them from the
webhookRequest.
intentInfo.parameters.<parameter-id>.
resolvedValue json body:
{
intentInfo : {
parameters: {
param1: {
originalValue: "sample1"
resolvedValue: "sample1"
}
}
}
}
Here’s a sample webhook code using Node.js extracting the resolved value of the “param1” parameter:
let yourParameter = request.body.intentInfo.parameters.param1.resolvedValue;
Note that you would need to enable webhook for the
Route that extracts the Intent parameters.
{
pageInfo : {
formInfo: {
parameterInfo: [
{
displayName: "param2"
value: “sample2”
}
]
}
}
}Here’s a sample webhook code using Node.js extracting the value of the “param2” parameter:
let yourParameter = request.body.pageInfo.formInfo.parameterInfo[0].value;Note that you would need to enable webhook for the Form parameter.
3. Intent and Form parameters are also written to the session and become
Session parameters.
You can get Session parameters from the
webhookRequest.
sessionInfo.parameters.<parameter-id> json body:
{
sessionInfo : {
parameters: {
param3: "sample3”
}
}
}Here’s a sample webhook code using Node.js extracting the value of the “param3” parameter:
let yourParameter = request.body.sessionInfo.parameters.param3;