Box SDK created_by shows anonymous but I can see "uploader" in the Box UI

39 Views Asked by At

I am using the boxsdk to list all files in a box folder

request_url = f"https://api.box.com/2.0/folders/{folder_id}/items"
request = self.client.make_request("GET", request_url, params={"limit": limit, "offset": offset,
                                                               "fields": ["created_by"]})
data = request.json()

data contains a key "entries" with the list of files metadata in the folder. There I can see the additional field requested "created_by" but unfortunately it shows as "Anonymous User": {'type': 'user', 'id': '2', 'name': 'Anonymous User', 'login': ''}.

Surprisingly, I can see "Updated" column in the Box web UI, with values there, like "Yesterday By [email protected]". I have tried also passing the "modified_by" in the fields list, but it still gives me the infamous Anonymous User back.

Has anyone had any luck accessing the email of the person who uploaded the file via the Box Python SDK?

1

There are 1 best solutions below

0
MarcelD On

I needed to pass "uploader_display_name" in the "fields" list. Counter-intuitively, this returns the email of the person who uploaded the file