0
votes

When I try to get the events but entering a valid stream_position, I am getting the correct response. However, when I give stream_position = 0, I am getting a "out_of_date" message instead of getting the complete list of all the events in the box cache as claimed in the api documentation of box. Please find below the sequence of requests/response when stream_position is 0.

Request : Calling the get method for the url https://api.box.com/2.0/events

Response: {u'next_stream_position': 1388316267169, u'entries': [], u'chunk_size': 0}

Request :Calling the options method for the url https://api.box.com/2.0/events

Response : {u'entries': [{u'url': u'http://2.realtime.services.box.net/subscribe?channel=c403627ae43a88af895d&stream_type=all', u'max_retries': u'10', u'retry_timeout': 610, u'type': u'realtime_server', u'ttl': u'10'}], u'chunk_size': 1}

Request: http://2.realtime.services.box.net/subscribestream_position=0&stream_type=all&channel=%5Bu%27c403627ae43a88af895d%27%5D

Response : {u'message': u'out_of_date', u'version': 1}

1

1 Answers

0
votes

My mistake!

There is no need to use the long polling method. All we needed to do for this use case is to directly call events with parameter as zero.