API and custom_event_hooks

The HTTP & Python API
Post Reply
Posts: 5
Joined: November 28th, 2017, 12:27 am

API and custom_event_hooks

Post by chrisg »

Are API calls able to trigger custom event hooks?

From what i can see from my own experiments, it appears as if they do not. Which leaves a big ol' hole in data integrity if we're using the hooks to do Other Things Elsewhere.


User avatar
Site Admin
Posts: 287
Joined: June 24th, 2014, 8:10 am

Re: API and custom_event_hooks

Post by andrew »

Hi Chris,

Event hooks are only triggered by internal events that the end user does not have control over or access to. We purposely do not have the API triggering event hooks and left this up to the user coding to the API to call the same function the event hook is using at the appropriate time, ie if you call the addShot API function, then be sure to call whatever function your onShotCreate event hook is calling directly after. Additionally it is possible to call the API from an event hook which could start to create and endless loop of events if they called each other.


Post Reply