Skip to main content
Question

Search API only by date

  • May 21, 2025
  • 8 replies
  • 61 views

Forum|alt.badge.img

Hello,

 

Is there currently a way to search for files by created at date only? I am trying the following:

 

search?query=&type=file&created_at_range=20**removed**T13:35:**removed**:00,20**removed**T13:35:**removed**:00&ancestor_folder_ids=removed for privacy0&limit=20

But it doesn't like the empty query. The endpoint does not support wildcards in the query so how can I get aroudn this and just get files created in that date range?

8 replies

Forum|alt.badge.img

 It's currently not possible to search for files by create date only. The query parameter is required when calling the search endpoint. 


Forum|alt.badge.img

Since the query param is required, but the search is strictly by create date (or modify date), is there a wildcard we can simply pass for the query parameter?  Or can you think of a value to pass that would be in ALL of the user's accessible files (even shared or enterprise content)?

 

Thanks,

AJ


Forum|alt.badge.img

Why does this the question was "solved" when the link just takes you to the last answer which provides no solution?


Forum|alt.badge.img

Can you suggest an alternative for this use-case?  What is a way to get only files created after a specified date without crawling the entire hierarchy of folders and files?


Forum|alt.badge.img

 One workaround would be to call the Enterprise Events endpoint and request Upload events. This will return all file upload events within your company's Box instance over the trailing 365 days. You can specify the needed date range using the created_after parameter.

 

 


Forum|alt.badge.img

Thanks for your response, .

 

I've given that endpoint a peek and it looks like something I could use to get the information.  I see the note in the docs indicating that I must use an enterprise admin account to use it.  My account (a "service account") has access to the admin console which indicates that it's set up as some sort of admin, but I don't think it qualifies as the enterprise admin account.

 

When I call the endpoint, I get an error message that seems to support this:

{"Bearer realm=\"Service\", error=\"insufficient_scope\", error_description=\"The request requires higher privileges than provided by the access token.\""}

 

I'm going to ask my operations team if I can use a more priviledged account for my service, but I'm not hopeful that they will allow it (and it doesn't feel like a best practice to use a super-special-enterprise-admin account for a service that just needs to query for recent files).

 

While I await a response from my team, can you think of another option that might work here?

 

Thanks again.

 

EDIT: When in the Admin Console, in the right column under "Account Information", it indicates that my account is a "CO-ADMIN".  Shouldn't this be sufficient to query the enterprise event stream?


Forum|alt.badge.img

I'm having the same issue and have not found a solution yet. Does anybody in the community have a suggestion on how to get this response?


Forum|alt.badge.img

Thanks for your feedback. Could you please open a feature request at pulse.box.com and our product team will review it?