Очевидно, Zapier отправляет объект типа «строка-массив», который выглядит так:
Код: Выделить всё
"[{'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}]"
В моем WebHook я декодирую полезную нагрузку следующим образом:
Код: Выделить всё
$payload = json_decode(file_get_contents("php://input"), true);
Код: Выделить всё
print_r($payload);
Код: Выделить всё
[{'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}]
Как добавить к значениям двойные кавычки?
Подробнее здесь: https://stackoverflow.com/questions/793 ... -to-values
Мобильная версия