0

sample dialogflow data

I'm trying to fetch the custom payload data using the API but I'm not able to do it using the get message call, I'm able to get the text response data from the intent but not the custom payload data which is JSON data.

language: PHP code used:

$intent = $intentsClient->getIntent($formattedName, ['intentView' => 1]);
$mrp = $intent->getMessages();
$messageIterator = $mrp->getIterator();
$customPayloads = [];
foreach ($messageIterator as $message) {
    $payloadObject = $message->getpayload();
    echo gettype($payloadObject);
    $tt = $payloadObject->getmessage();
    print_r($tt);
}

Result for code from API client:

NULL {"error_code":"500ERROR","error_message":"InternalServerError","ok":false,"error_value":"Call to a member function gettext() on null" }

Mahmoud Abdelsattar
  • 1,299
  • 1
  • 15
  • 31
user
  • 9
  • 2
  • If that custom payload from your screenshot there is supposed to be JSON - then use proper quotes, `"`, and not typographical ones. – CBroe Sep 19 '22 at 13:45

0 Answers0