Post

2 followers Follow
0
Avatar

How do I see which field is update when running a item.update webhook?

Hi,

I have successfully set up my webhook for item.update but I can't seem to figure out how to get the specific field that is updated. I see that there is a Get item revision reference in the API description but I don't understand how I should use it. I get the item_id from the webhook so how can I use that to get which item that was actually updated.

Thanks!

/ Ismail

Ismail Pelaseyed Answered

Please sign in to leave a comment.

3 comments

0
Avatar

First off, if you only want your webhook to fire when a specific field is updated you can use field level webhooks. That can often make things easier. See the "Apps" section here: https://developers.podio.com/doc/hooks

With that out of the way: You just use the normal API operations. Since you only get the item_id you probably want to use Get Item or Get Item Basic before you do anything else. Either will contain information on the current revision and you can use that to compare revisions.

All the best,

Andreas

Andreas Haugstrup Pedersen 0 votes
0
Avatar

Thanks Andreas,

Would this be the correct way of creating  a filed hook:

$hook_url = "http://www.some-url.com/hook.php";

$field_id = THE_FIELD_ID;

PodioHook::create( "app_field", $field_id, $attributes = array('type' => 'item.update', 'url' => $hook_url) );

Thanks again!

Qvido 0 votes