one of the application is sending a webhook callback as HTTP Post, from which I need to parse a JSON blob dump (custom_fields in the below URL). Here is one such POST from a server application:
In my code:
$custom_fields= json_decode($_REQUEST['custom_fields'], true);
$f1 = $custom_fields['Field_63520']['value'];
$f2 = $custom_fields['Field_87630']['value'];
$f3 = $custom_fields['Field_76855']['value'];
I get error/warning,
PHP Warning: Illegal string offset 'Field_63520' in webhook.php on line 70
PHP Warning: Illegal string offset 'value' in webhook.php on line 70
...
f1:{
f2:{
f3:{
when I print the $custom_fields, I get:
{\"Field_87630\": {\"value\": \"uname1\", \"label\": \"user_name\", \"required\": \"on\", \"type\": \"char\"}, \"Field_63520\": {\"value\": \"1234\", \"label\": \"auction_id\", \"required\": true, \"type\": \"char\"}, \"Field_76855\": {\"value\": \"tx1\", \"label\": \"tx_type\", \"required\": \"on\", \"type\": \"char\"}}
I am kind of stuck here without knowing how to proceed. Any suggestions would help. Thanks.