AnsweredAssumed Answered

Leads: How to access JSON request in a hook?

Question asked by Harald Kampen on Nov 12, 2014
Latest reply on Nov 12, 2014 by Jeff Bickart
If have a hook for leads which was working fine in 6.5. Now, I have the problem that there is not usefull request available.

It was like that;
<?php
class MyBead
{
    public function myAction($bean, $event, $arguments)
    {
        if ($_REQUEST['status'] != $bean->status) {
            $this->checkStatus($bean);
        }
    }
} ?>


I tried following with var_export():

$HTTP_RAW_POST_DATA
Error: Notice:  Undefined variable: HTTP_RAW_POST_DATA in ...
Output: NULL

$_POST
Output: array ()

file_get_contents('php://input')
Output: ''

$_REQUEST
Output: array (
  '__sugar_url' => 'v10/Leads/96566761-2454-6ca0-2dab-5375d834e6d0',
  'viewed' => '1',
)

I also didn't found a Request object.

How can I access the request vars from JSON PUT request?

Outcomes