Is this a bug of Box API v2 when getting events

2020-07-24 04:50发布

问题:

I have spotted an strange behavior when getting events from Box using the BOX API v2.

The scenario I got is like follows:

  1. Upload 14 files to the box.net using box API v1.
  2. Get events using stream_position=now, this gives a stream position, say 1234 and no entries are returned.
  3. Get events using stream_position=1234, this gives a new stream position, say 7890 and no entries are returned.
    (Until this point it is all as expected)
  4. Get events using stream_position=7890, now this gives a dummy number of events which have behavior "ITEM_UPLOAD" and some files I uploaded in step one.

I expect if no file events happens after step 1, all the consequent get events calls will return zero entries.

Is this a bug in Box.NET API V2?

Since I use API v1 and API v2 at the same time, are they compatible?

回答1:

This isn't a bug. The files you uploaded at step 1 simply were not replicated to the events system at the time of your #3 call. They made it there by #4. There is an inherent delay between uploading your files and the events being published to the API. How quickly did you do this whole process?

Let us know if you have any additional questions about using the /events endpoint, or any of the other V2 API endpoints.

And to answer your second question, yes, the V1 and V2 apis are compatible to be used together. If you need some functionality from a V1 API, then you can intermingle V1 and V2 api calls.