How to call API on event based

I think your problem is similar to this one: