Thank you. Now I get events, but - it shows only one time. Second time when I checking events - there is no event, but I need to get last events of each unit

Hi,
I want to get Unit's all events (most important to get "Unit status") via PHP. I am getting all other information about unit, but with events - it not works. Can anyone help in this case?