<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Python API in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289418#M17722</link>
    <description>&lt;P&gt;Thanks&amp;nbsp; Greg for your time.&lt;/P&gt;
&lt;P&gt;1) I was looking into&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.sharing.UserFileMembershipInfo" target="_blank" rel="nofollow noopener noreferrer"&gt;UserFileMembershipInfo&lt;/A&gt;&amp;nbsp;and get some value information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I'm working now with&amp;nbsp;&lt;SPAN&gt;Dropbox Business API app "team auditing" access, you can please show me how can I get the 'File_download' events. I don't know how to do,&amp;nbsp; I was trying this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;import dropbox&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;token= '&amp;nbsp; &amp;nbsp; '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;dbx_team = dropbox.DropboxTeam(&lt;SPAN&gt;token&lt;/SPAN&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Resultado = dbx_team.team_log_get_events(limit=1000, account_id=u'dbid:fsfdsddf', time=None, category=none)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;print(Resultado)&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 07 Aug 2018 12:42:40 GMT</pubDate>
    <dc:creator>AdanHerrera</dc:creator>
    <dc:date>2018-08-07T12:42:40Z</dc:date>
    <item>
      <title>Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289082#M17703</link>
      <description>&lt;P&gt;I'm working with Python &amp;amp; API v2&lt;/P&gt;&lt;P&gt;I need the following information:&lt;BR /&gt;If I have a shared folder with several users, is it possible to obtain a record of the users who have visited or downloaded the files?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;---------------------&lt;BR /&gt;I was reading this information but I do not know if it's what I'm looking for.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;class dropbox.sharing.UserFileMembershipInfo (access_type = None, user = None, permissions = None, initials = None, is_inherited = None, time_last_seen = None)&lt;BR /&gt;Bases: dropbox.sharing.UserMembershipInfo&lt;/P&gt;&lt;P&gt;The information about a user member of the shared content with an appended last seen timestamp.&lt;/P&gt;&lt;P&gt;Variables: time_last_seen - The UTC timestamp of when the user has last seen the content, if they have.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:11:15 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289082#M17703</guid>
      <dc:creator>AdanHerrera</dc:creator>
      <dc:date>2019-05-29T09:11:15Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289226#M17712</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.sharing.UserFileMembershipInfo" target="_blank"&gt;UserFileMembershipInfo&lt;/A&gt; object is used in&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.sharing.SharedFileMembers" target="_blank"&gt;SharedFileMembers&lt;/A&gt;, which is returned by&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.sharing_list_file_members" target="_blank"&gt;sharing_list_file_members&lt;/A&gt;. That only applies to specific files that have been shared individually, not to files inside shared folders. That being the case, it sounds like this isn't what you're looking for in your scenario.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There isn't an equivalent property for files in shared folders, though if you're using a&amp;nbsp;Dropbox Business API app with "team auditing" access , you can get &lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.team_log.EventType.file_download" target="_blank"&gt;'file_download' events&lt;/A&gt; from&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.team_log_get_events" target="_blank"&gt;team_log_get_events&lt;/A&gt; and&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.team_log_get_events_continue" target="_blank"&gt;team_log_get_events_continue&lt;/A&gt;.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Aug 2018 17:24:52 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289226#M17712</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-06T17:24:52Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289418#M17722</link>
      <description>&lt;P&gt;Thanks&amp;nbsp; Greg for your time.&lt;/P&gt;
&lt;P&gt;1) I was looking into&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.sharing.UserFileMembershipInfo" target="_blank" rel="nofollow noopener noreferrer"&gt;UserFileMembershipInfo&lt;/A&gt;&amp;nbsp;and get some value information.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) I'm working now with&amp;nbsp;&lt;SPAN&gt;Dropbox Business API app "team auditing" access, you can please show me how can I get the 'File_download' events. I don't know how to do,&amp;nbsp; I was trying this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;import dropbox&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;token= '&amp;nbsp; &amp;nbsp; '&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;dbx_team = dropbox.DropboxTeam(&lt;SPAN&gt;token&lt;/SPAN&gt;)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;Resultado = dbx_team.team_log_get_events(limit=1000, account_id=u'dbid:fsfdsddf', time=None, category=none)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="1 2 3 4 5 6 7"&gt;print(Resultado)&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 12:42:40 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289418#M17722</guid>
      <dc:creator>AdanHerrera</dc:creator>
      <dc:date>2018-08-07T12:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289512#M17732</link>
      <description>&lt;P&gt;It looks like you have the right basic idea, but there are a few things to note:&lt;/P&gt;
&lt;P&gt;- You have 'none' instead of 'None'.&lt;/P&gt;
&lt;P&gt;- You can filter by category, which in this case would be 'dropbox.team_log.EventCategory.file_operations'.&lt;/P&gt;
&lt;P&gt;- You can filter by time, which can be good as without a time filter you may have to parse through more events than desired.&lt;/P&gt;
&lt;P&gt;- You need to check&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.team_log.GetTeamEventsResult.has_more" target="_blank"&gt;GetTeamEventsResult.has_more&lt;/A&gt;, and call back to&amp;nbsp;&lt;A href="https://dropbox-sdk-python.readthedocs.io/en/latest/moduledoc.html#dropbox.dropbox.Dropbox.team_log_get_events_continue" target="_blank"&gt;team_log_get_events_continue&lt;/A&gt; if it's True.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, for example, to look for file_download events from the past week, that might look like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import datetime

import dropbox

access_token = '...'
dbx_team = dropbox.DropboxTeam(access_token)
account_id = 'dbid:...'
time_range = dropbox.team_common.TimeRange(
    start_time=datetime.datetime.now() - datetime.timedelta(days=7))

def handle_events(events):
    print("Processing %s events..." % len(events))
    for event in events:
        if event.event_type.is_file_download():
            print(event)

result = dbx_team.team_log_get_events(
    limit=1000,
    account_id=account_id,
    time=time_range,
    category=dropbox.team_log.EventCategory.file_operations)
handle_events(result.events)

while result.has_more:
    result = dbx_team.team_log_get_events_continue(result.cursor)
    handle_events(result.events)&lt;/PRE&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:26:22 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289512#M17732</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-07T18:26:22Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289622#M17741</link>
      <description>&lt;P&gt;Perfect.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1- In this case&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;you&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;are filtering by (account_id) and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;getting the events of a specific user, but we can do the same&amp;nbsp;&lt;SPAN&gt;filtering&amp;nbsp;for example by a folder and getting the events of the users in this path?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2-&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;In the result I see this event&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;EventType(u'file_download', FileDownloadType(description=u'Downloaded files and/or folders'))&lt;/STRONG&gt;, could it be programmed so that it only prints this type of events?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again, I hope I'm not asking a lot of questions&lt;/P&gt;</description>
      <pubDate>Wed, 08 Aug 2018 09:19:05 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289622#M17741</guid>
      <dc:creator>AdanHerrera</dc:creator>
      <dc:date>2018-08-08T09:19:05Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289672#M17744</link>
      <description>1. No, unfortunately there isn't a way to filter by path across all members, but I'll pass this along as a feature request. &lt;BR /&gt;&lt;BR /&gt;2. Also no, it's not possible to filter to a specific event type, but we'll consider this a feature request as well.</description>
      <pubDate>Wed, 08 Aug 2018 14:27:23 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/289672#M17744</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-08-08T14:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Python API</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/547056#M26076</link>
      <description>&lt;P&gt;&lt;SPAN&gt;i am also searching for the same problem solution altough i'm reading a book to master python named as&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://python.engineering/python-data-science-handbook/" target="_blank" rel="external nofollow noopener noreferrer"&gt;Python data science handbook PDF&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Sep 2021 07:44:12 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Python-API/m-p/547056#M26076</guid>
      <dc:creator>John112233</dc:creator>
      <dc:date>2021-09-26T07:44:12Z</dc:date>
    </item>
  </channel>
</rss>

