Hello I get an $response from an API post request, below is the $response
LINE\LINEBot\Response::__set_state(array(
'httpStatus' => 200,
'body' => '{"richMenuId":"richmenu-5a489c22120e48cec70f3c3cd3b318db"}',
'headers' =>
array (
'server' => 'openresty',
'date' => 'Thu, 03 Feb 2022 11:31:51 GMT',
'content-type' => 'application/json',
'content-length' => '58',
'cache-control' => 'no-cache, no-store, max-age=0, must-revalidate',
'expires' => '0',
'pragma' => 'no-cache',
'x-content-type-options' => 'nosniff',
'x-frame-options' => 'DENY',
'x-line-request-id' => '84ababf8-81e9-4cda-aeb0-25d9b44e9b24',
'x-xss-protection' => '1; mode=block',
),
))
Can someone tell me how I could access the "richMenuId" from above object?
I tried to access the object as followed
$response->body->richMenuId
This gives me an error:
Cannot access private property LINE\\LINEBot\\Response::$body
I have also tried changing the object to an array using answers on SO but was not able to solve it.
This is probably a noob question but any input is highly appreciated. Thanks