Post

1 follower Follow
1
Avatar

Podio item.update webhook to open a new link

I have setup a webhook in Podio for an item.update in hook_update_item.php file. What I want to do if an item has been updated, I want to open a link preferably in a new tab, here is the code that I have:

<?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 has already been validated so I am assuming when webhook is firing it goes to the 'item.update'. But so far no luck on bringing up a new tab of google page. Appreciate any tips and suggestions!

Marvin Quezon

Please sign in to leave a comment.