Join BoxWorks in San Francisco Nov 12-13! Keynotes, product demos, and Box Master Classes. Reserve your spot!

ask help, I don't know why the message of long poll response is out_of_date?

Answered
New post

Comments

1 comment

  • mwiller

    Hi  — I believe this is because the long poll endpoint is designed to help you wait for new events to appear, but stream position 0 essentially means "from the first available event" — that's too long ago to be realistically waiting for and is considered "out of date".  The expectation is that the stream_position you use for long polling should be relatively recent.  If you want to get events from the first available one, you can call the User Events API endpoint directly with stream position 0 to get events starting from the first available one.  You can keep calling that endpoint, replacing the stream_position parameter with the next_stream_position value from the response you got until there are no more events returned.  Once you have consumed all the already-available events, then you can start long polling with whatever position the next_stream_position field in that final empty events response gave you.  You may find the Event Long Polling guide useful, if you haven't already read it!

     

    Alternatively, if you just want to start getting the events from the current time, you can just call the long poll URL without specifying a stream_position.

    0
    Comment actions Permalink

Please sign in to leave a comment.