The infinite loop ends up in using up the rate limit.
Will an item update done via the API trigger hooks?
I am currently working on a script, which goes on an infinite loop after an update, by probably triggering the update hook on each update.
My understanding was that an update via API wouldn't trigger the hook.
If this is true, is there a way to prevent this behavior?
Please sign in to leave a comment.
I will add a parameter to the item API methods so you can disable hook calls for your change. I will let you know when it is ready.
Awesome, waiting for your update.
Thanks a ton. :)
In the mean time you can look for the created_via on the lastest revision to see who made the update and halt if it was your own integration.
The item create, update and delete methods now have a "hook" parameter, you can set to false to avoid hook calls.
Thank you very much for the feature.
Also, thanks Andreas, for suggesting the workaround.
Has this "hook" parameter been added in the Java wrapper?
Thanks in advance!
Could someone post an example of using the hook parameter in a php item delete call ? Does the hook parameter go in the options array or the attributes array or what ?
It's a little unclear, yeah. Hook and Silent parameters always to into the options array in podio-php
I can see the Silent parameter in the Java API client for item create, update, and delete; however, I do not see the Hook parameter. Is it possible for hooks to be disabled if the Hook parameter is added in the same way as the Silent parameter in podio-java? Why does podio-java include the Silent param and not the Hook?
The hook parameter was introduced much later than silent and was probably just never added to the java client. Should be simple to add yourself. If you're feeling adventurous you can make the change and create a pull request on github so we can get it added to the main repository. :)
Thank you again Andreas and Christian for your help!
The hook parameter is now available in the Java wrapper for item update.
All the best!
It seems like "file.change" API is not considering the hook => false parameter and triggering further hooks. Can you please check this
Can you help on this. We are working on an integration which needs the file.change hook work proper with this parameter. The work around suggested by Andreas will not be helpful for us in some cases.