Trying to build a WebHook in PHP and send it some data from Zapier, so I am testing in Postman.
Apparently, Zapier is sending a "array-string" type object that looks like this:
"[{'id': 1234, 'campaign_name': 'SOME CAMPAIGN NAME', 'campaign_type': 'Single Content', 'action_type': 'Email', 'topic': 'NONE', 'country_target': 'US', 'created_at': 1702230370167, 'modified_by': 'MYEMAIL@YAHOO.COM', 'isactive': True, 'ispublish': True, 'user_id': 111, 'modified_at': 1736543477011}]"
Postman doesn't like the single quotes.
In my WebHook, I am decoding the payload like this:
$payload = json_decode(file_get_contents("php://input"), true);
Then I print it like this:
print_r($payload);
I thought the decode would work, but it still has the single quotes. Printing the payload looks like this:
[{'id': 1234, 'campaign_name': 'SOME CAMPAIGN NAME', 'campaign_type': 'SingleContent', 'action_type': 'Email', 'topic': 'NONE', 'country_target': 'US', 'created_at': 1702230370167, 'modified_by': 'MYEMAIL@YAHOO.COM', 'isactive': True, 'ispublish': True, 'user_id': 111,'modified_at': 1736543477011}]
Still has the single quotes.
How can I add double quotes to the values?