我已经在 Podio 中为hook_update_item.php文件中的 item.update 设置了一个 webhook。如果项目已更新,我想做什么,我想最好在新选项卡中打开一个链接,这是我拥有的代码:
<?php
require ("../podio/PodioAPI.php");
Podio::setup(Client ID, Client Secret);
Podio::authenticate_with_app(App ID, App Token);
switch ($_POST['type']) {
case 'hook.verify':
// Validate the webhook
PodioHook::validate($_POST['hook_id'], array('code' => $_POST['code']));
case 'item.update':
// Do something. item_id is available in $_POST['item_id']
if ($_POST['item_id'] == '238777597'){
//open new link here
$ch = curl_init('http://www.google.com.ph');
curl_exec($ch);
}
}
?>
Podio webhook 已经过验证,所以我假设当 webhook 触发时,它会转到“item.update”。但到目前为止,在打开谷歌页面的新标签方面还没有运气。感谢任何提示和建议!