I tried the logic of long polling for monitor standard events, and it worked very well. However, I ran into issue when trying to monitor enterprise events.
here is what I did (Access token used here is for co-admin account):
- initialize long poll to get next_stream_position [at this step, I could not specify stream_type=admin_logs in the url, which gave 400 Bad Request back]
- after getting new_stream_position, I sent OPTIONS request to box for long poll url [at this step, I could not specify stream_type=admin_logs, which gave 400 Bad Request back]
- after getting long poll url, I sent request to the given long poll url, but then never got "new_change" back (some events under some enterprise non-admin account occurred during the waiting time).
However, using the same Access token, I could send request to box by using " curl https://api.box.com/2.0/events?stream_type=admin_logs&limit=10&stream_position=0 -H \"Authorization: Bearer ACCESS_TOKEN\" ", and got expected events response back.
So, my question is: is it possible to use the long poll mechanism to real-time-ly monitor enterprise events?
thanks.