user1893918
user1893918

Reputation: 21

List of files from box.com

I am trying to sync files uploaded in Box with another external system. Which API(s) do I use to get a "list of all files uploaded/updated after given dd/mm/yy hh:mm:ss"?

cheers!

Upvotes: 2

Views: 1697

Answers (1)

John Hoerr
John Hoerr

Reputation: 8025

I think the User Events API is going to be your best option. This API will return to you the stream of events for a given user. You will then need filter that stream down a bit per your requirements. Some things to consider:

  • This API doesn't return to you a list of events relative to a specified timestamp. Instead, each event has a created_at field that you can use to filter down the result set to a particular point in time.
  • The API doesn't feature super fine-grained event type filtering, ala 'only show me file create/update events.' Instead, each event has an event_type field that indicates the nature of the event and can be used for filtering the results. The event types that might interest you are:
    • ITEM_CREATE (File or folder created)
    • ITEM_UPLOAD (File or folder was uploaded [modified])
    • ITEM_MOVE (File or folder was moved)
    • ITEM_COPY (File or folder was copied)
    • ITEM_TRASH (File or folder was marked for deletion)
  • As you might notice, each event type listed above applies to Files AND Folders. If you are strictly interested in files, then the event source field has a type property that indicates whether the item is a file or folder.

Hope that gets you pointed in the right direction!

Upvotes: 3

Related Questions