Box Developers
Jun 22, 2017 · 2 min read

When building an application or integration with Box Platform, you might want to pull a list of files that a user has recently interacted with. Perhaps you’re building a project management application, where a person has several projects that he or she is involved with, but you want to provide a quick view of all their files across multiple projects without the user having to dig into each individual folder.

At Box, we’ve added this feature to our own applications across web, iOS, and Android, including Box Notes, to help Box users easily pick up where they left off when working with their content in the cloud. Today, we’re excited to introduce this functionality as an API with the Recent Items API.

The Recent Items API allows you to retrieve a list of a user’s recently accessed files. The Recent Items object tracks any items that a user has accessed in the last 90 days or the last 1,000 items accessed, which can be retrieved with a simple GET request. In the request, you specify the fields you want to see, the number of recent items to return (the default is 100 items), and the position marker at which to begin the response.

Here’s an example request:

curl “Authorization: Bearer Dq2k1BC8ZpbQee314FnV2UmACFB8VnlT”

The response will return a list of files that a user has interacted with, including the file name, file ID, and time of interaction, along with the nature of the interaction. Interactions that are available include:

  • item_modify, where a user has modified a file in Box
  • item_preview, where a user has viewed a preview of a file
  • item_upload, where a user has uploaded a file
  • item_comment, where a user has added a comment to a file

Here’s an example 200 response from the Recent Items API:

{“next_marker”: “”,“limit”: 100,“order”: {“by”: “interacted_at”,“direction”: “DESC”},“entries”: [{“type”: “recent_item”,“interaction_type”: “item_preview”,“interacted_at”: “2017–06–06T15:46:28–07:00”,“item”: {“type”: “file”,“id”: “181937331928”,“file_version”: {“type”: “file_version”,“id”: “192865288152”,“sha1”: “d0a8c75ba72bf923bfb0c855bbcf1e8f7cc817dd”},“sequence_id”: “0”,“etag”: “0”,“sha1”: “d0a8c75ba72bf923bfb0c855bbcf1e8f7cc817dd”,“name”: “File2.txt”},“interaction_shared_link”: null},{“type”: “recent_item”,“interaction_type”: “item_preview”,“interacted_at”: “2017–06–06T15:46:27–07:00”,“item”: {“type”: “file”,“id”: “181937443182”,“file_version”: {“type”: “file_version”,“id”: “192865400174”,“sha1”: “12a715416bc96ba3ea860480c815657d5e0809da”},“sequence_id”: “0”,“etag”: “0”,“sha1”: “12a715416bc96ba3ea860480c815657d5e0809da”,“name”: “Image1.png”},“interaction_shared_link”: null}]}

To learn more about the Recent Items API, you can check out the developer documentation. If you have any questions about the Recent Items API, you can post them in the Box Developer Forum or reach out to us on Twitter. If you don’t have a Box Developer account, you can sign up for an account here or log in using your Box account credentials.

Box Developer Blog

Cloud content management APIs

Box Developers

Written by

Box Developer Blog

Cloud content management APIs

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade