Stop web hooks repeating

Discussions relating to the REST API of Jiwa 7.

Stop web hooks repeating

Postby SBarnes » Mon Jul 20, 2020 4:37 pm

In looking at a way to change webhooks to call a separate API, Mike made the suggestion on this post viewtopic.php?f=32&t=1329 to double hop things, which should work fine.

The only thing is I then need to store the ID of the external system against the entity such as a debtor which will then cause another hook to fire unnecessarily.

The only way around this that I can think of is to use a custom field on the entity and in the stave start set this to a guid and then store this value also into a secondary table with the debtor id and date inserted and then when the subsequent hooks fire see if the last update was from a hook update by looking at the guid in the table and on the debtor to see if they are the same, if they are different then call the api again to do further updates.

This unless someone has a simpler idea on how to overcome the issue.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1617
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Return to REST API

Who is online

Users browsing this forum: No registered users and 1 guest

cron