
Note that the webhook you set on the parameter is called before the parameter is collected.
In order to have a webhook called after the parameter value gets collected, you should add a transition route with a condition "$page.params.xxx.status = "UPDATED"" and enable webhook for validating the parameter. Below is an example where it loops on the page if the required parameter is not met.

{
"fulfillmentResponse":{
"messages":[
{
"text":{
"text":[
"Response from Webhook"
]
}
}
]
},
"pageInfo":{
"formInfo":{
"parameterInfo":[
{
"displayName": "parameter-name",
"required": true,
"value": "<optional>",
"state":"INVALID"
}
]
}
}
}
Note that any additional validation will depend on how you design your backend.

.png?part=0.4&view=1)
Hi,
Please see answers to the following queries:
1. “The query here is, in the form parameter do I need to call the webhook for validation or else the webhook should be called inside the Routes handler. (i.e., Can I able to do the validation within parameters itself or else in the Routes)”
The webhook should be called inside the routes. In the condition route, $page.params.authCheck.status = “UPDATED”, add a webhook to validate the input and send the INVALID enum if the value is invalid in your webhook response.
2. “In the event handlers under the form parameters, do I need to configure the transition page? If yes means which page I need to configure current page or target page. Same doubt in the Routes as well.”
Since the validation is happening on the webhook, you need to transition to the target page or target flow by adding the transition in your webhook response if the input is valid. If the input is invalid, the Invalid Parameter event handler should be triggered. Depending on your agent design, you may add a transition on the Invalid Parameter event handler.
3. “Finally the JSON response I'm trying to send from the Routes fulfillment when the parameter is invalid. Do I need send any specific response, if the parameter is valid.”
It depends on how you will design your agent. However, it is better if you have a response if the parameter is valid. This will also help you determine that validating the input is successful.