you can get web hook or the param from the third party’s API, set the API to run when current page user is active. that is it will stop working when there is no activity on the page