I add my url xxx/getjson.php to a webhook and once a person signup, it will post the json data to my url. I use http://requestb.in/ to check the data and the result is like this:
payload{ "signup": { "address": { "address1": "XX",
"country": "United States"},
"id":22}}
token
the php script i write is:
$obj=json_decode($_POST); //cannot get the json data
$userid=$obj->signup->id;
Also I don't know how to use the 'payload'
I find a similar sample code and I test it well using their web hooks. http://support.unbounce.com/entries/307685-how-does-the-form-webhook-work However, they use 'data.json' rather than 'payload' as parameters.
$form_data = json_decode($unescaped_post_data['data_json']);
$userid= =$form_data->signup->id;
I used their stripslashes_deep function, and replaced the 'data_json' with 'payload' but still doesn't work.
I really appreciate your help.Thanks!