Unable to get custom payload data from the intent using API v2 without using fulfillment

Viewed 32

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" }

0 Answers
Related