Get previous filename
I am working with an enterprise account and attempting to get the version history of a file, specifically to get its previous filename for a RENAME event. I am a co-admin in the account.
Using the Box UI I rename a file.
I can get a list of RENAME events and obtain a file id from the endpoint
https://api.box.com/2.0/events?stream_type=admin_logs&event_type=RENAME
However when I get the file id and request the following endpoint I get an empty set.
https://api.box.com/2.0/files/{file_id}/versions
{ "total_count": 0, "entries": [], "limit": 1000, "offset": 0 }
I would have expected at least one entry in here containing the previous filename? If I use the Box UI to query the file version history it again does not show any version history. However if I run a 'Renamed' report via the UI it includes the previous filename so it must be stored somewhere...
Is a new version of the file not created when it is renamed? If not how do I get the previous name of a file that has been renamed?
-
I've come across a similar question on Stackoverflow which has remained unanswered so I can only assume that this feature is not supported, which I find very surprising.
I find it flawed that renaming a file in the Box web UI would not create a new version of that file.
The information is available somewhere as I can see the previous name of the file when I run a Rename report in the web UI, however for some reason this does not seem to have made it to the public API.
Please sign in to leave a comment.
Comments
1 comment