Access Statistics on Files for share links
I known I can get a preview count and download count with below codes. I downloaded this file with share link just one time, but I got 3 counts for download_count. So I think a download count includes a preview count, is't right?
Thanks any help.
file_id = '123456' shared_link = client.file(file_id).get().shared_link shared_link['preview_count'] 2 shared_link['download_count'] 3
Versions Used Python SDK: 2.12.1 Python: 3.8.10
Hi @c-rei
Thanks for reaching out to us! The download_count shouldn't include the preview_count. It should only increment when file is downloaded. From my tests, it behaves this way. Are you sure you only downloaded this file once? Did you download the file from the browser or from the SDK?
Thanks, Mateusz
Hi @Mateusz
Thanks for your response. For confirmation, I've got the access statistics with Box Report, that looks attached image. So there are one download and two previews from anonymous user with shared link. That's all.
I should explain some Japanese like below: 日付=date, ユーザー名=User Name, ユーザーメール=User mail, 操作=Action, 対象=Target, 詳細=Details 匿名=Anonymous, 以前のコラボレータ=Previous collaborator, プレビュー=Preview, ダウンロード=Download

Thanks, c-rei
And I found that if I use a word file for shared link, I can get correct preview and download count each, but if I use a pdf file or a Excel file, I got a download count that includes a preview count.
Thanks, c-rei
Yes, I can indeed see this happening with a .pdf and .xlsx files. For some unknown reason the download count is incremented when the link is accessed. It seems to be a problem with the API itself. From the SDK side, we only return the API response in this case. I will contact the team responsible for SharedLinks internally to see if they are aware of this issue. If you further help with this issue you can try contacting support via https://support.box.com/hc/en-us/requests/new.
Thanks, Mateusz
This issue has been automatically marked as stale because it has not been updated in the last 30 days. It will be closed if no further activity occurs within the next 7 days. Feel free to reach out or mention Box SDK team member for further help and resources if they are needed.
This issue has been automatically closed due to maximum period of being stale. Thank you for your contribution to Box Python SDK and feel free to open another PR/issue at any time.