Skip to main content
Question

Webhook metadata for FILE.DELETE/TRASHED doesn't include name

  • May 22, 2025
  • 3 replies
  • 31 views

Forum|alt.badge.img

I have setup webhook (via API) on a particular folder to monitor for FILE.DELETED or FILE.TRASHED.

When a file is deleted from that folder, the metadata I receive from the BOX doesn't include the file name that got TRASHED. Json element "source.name" is available on TRASHEd/DELETED.

Metadata is shown below.

 

The catch is I can't turnaround and get  file name using BoxFile API using file-id (source.id) because the file is already trashed.

Any suggestions on how to get around this?

 

{ "type": "webhook_event", "id": "e17e66e3-24a2-480d-b5e8-aaaaaaa", "created_at": "2019-03-20T18:48:52+00:00", "trigger": "FILE.TRASHED", "webhook": { "id": "15555555", "type": "webhook" }, "created_by": { "type": "user", "id": "777777773", "name": "John", "login": "***email address removed for privacy***" }, "source": { "id": "425130999999", "type": "file" }, "additional_info": [] }

 

3 replies

Forum|alt.badge.img

If you haven't already, please open a case with product support at support.box.com! 

 

Best, 

Kourtney 


Forum|alt.badge.img

To get additional information about the trashed item, check this page out https://developer.box.com/reference#get-a-trashed-file, you use the File ID that is returned from box in this GetTrashedFile method and you'll get extra information like the file name, parent, creator etc.


Forum|alt.badge.img

Thanks for the pointer Dorien. 

That API will work for me. Too bad I have to turnaround and make a extra API call to get the filename. 

 

-Srini