| Server IP : 121.121.20.254 / Your IP : 216.73.216.202 Web Server : Microsoft-IIS/10.0 System : Windows NT WEB-SERVER 10.0 build 20348 (Windows Server 2022) AMD64 User : IUSR ( 0) PHP Version : 8.3.28 Disable Function : NONE MySQL : ON | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /inetpub/wwwroot/AIWEBSTATION/wp-content/plugins/wpbot-pro/ |
Upload File : |
<?php
/**
* @package Dialogflow Webhook by QuantumCloud
* @Since 9.3.8
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/**
* Callback function for Webhook
*
* @param [type] $request
* @return void
*/
function qcld_wpbot_dfwebhookcallback( $request ) {
// Authentication check.
if ( qcld_validate_authorization_header() ) {
// get all incoming requests.
$req = $request->get_params();
// Intent name
$intent = $req['queryResult']['intent']['displayName'];
// parameters
$parameters = $req['queryResult']['parameters'];
// Start custom code section.
// Write your fulfillment response in this block.
// ==========================
$json_reponse = '
{
"fulfillmentText": "This is from webhook_test response from webhook",
"fulfillmentMessages": [
{
"text": {
"text": [
"This is from webhook_test response from webhook"
]
}
}
]
}';
echo wp_json_encode( json_decode( $json_reponse ) );
// End custom code section.
// ================
// Please do not edit the below code.
} else {
wp_send_json(
array(
'success' => false,
'message' => 'Authorization failed.',
)
);
}
}