Your workflow is unique 👨‍💻 -  tell us how you use Dropbox here.

Forum Discussion

Saar A.'s avatar
Saar A.
Explorer | Level 4
9 years ago

events followed by api request

hey,

when I post download or get_preview request I get the content that I asked for, but I can't get event back. Is there anything to do about it?

8 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    I'm not sure I understand your question. What "event" exactly are you looking for from these API calls?
  • Saar A.'s avatar
    Saar A.
    Explorer | Level 4
    9 years ago

    I'm looking to get download file event for example as response when I use log\get_events after the request

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    I see, thanks for clarifying. The /1/team/log/get_events endpoint doesn't return events for API calls like this. From the documentation, these events are only reported for the web app:

     

    files    download_files        Download files from the webapp
    files    preview_files        Preview files from the webapp
  • Saar A.'s avatar
    Saar A.
    Explorer | Level 4
    9 years ago
    thanks for the clarification. What about edit file or restore file?
    Any time I edit file I recieve add_file and for restore file I get revert to previous revision. Any idea what to do?
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago
    Can you share the specific steps to reproduce these issues, and some sample output showing them? Thanks in advance!
  • Saar A.'s avatar
    Saar A.
    Explorer | Level 4
    9 years ago

    Of course.

    First, I realized that for editing a file I need to upload it with certain writeMode. I chose update(I assume that the rev is correct so I won't have any conflict).

    Post https://content.dropboxapi.com/2/files/upload

    Dropbox-API-Select-User: dbmid:AACQ8S3d39L9O3hcbMb9V1emEp31fZAwge8
    Connection: close
    Authorization: Bearer <redacted>
    Content-Length: 0
    Content-Type: application/octet-stream
    Host: content.dropboxapi.com
    User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_101)
    Accept-Encoding: gzip,deflate
    Dropbox-API-Arg: {"path":"/test1.txt"}

     

     

    Next I will edit it by using upload with this arguments(got last rev by get_metadata):

     

    Dropbox-API-Select-User: dbmid:AACQ8S3d39L9O3hcbMb9V1emEp31fZAwge8
    Connection: close
    Authorization: Bearer <redacted>
    Content-Length: 4
    Content-Type: application/octet-stream
    Host: content.dropboxapi.com
    User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_101)
    Accept-Encoding: gzip,deflate
    Dropbox-API-Arg: {"path":"/test1.txt", "mode":{".tag":"update", "update":"e2e31fbcd7b"}}

     

    This is the 2 events I get in return(I deleted irrelevant fields):

    {\"event_type\": \"add_files\", \"info_dict\": {\"actor_app_id\": 706966, \"is_dir\": false, \"file_id\": \"id:iyTVkdn9p0YAAAAAAAAG-Q\", \"host_id\": 3469059452, \"path\": \"/test1.txt\"}, \"event_type_description\": \"Added files\", \"event_category\": \"files\", \"time\": \"2016-10-27T05:01:13+00:00\",},

    {\"event_type\": \"add_files\", \"info_dict\": {\"actor_app_id\": 706966, \"is_dir\": false, \"file_id\": \"id:iyTVkdn9p0YAAAAAAAAG-Q\", \"path\": \"/test1.txt\"},  \"event_type_description\": \"Added files\", \"event_category\": \"files\", \"time\": \"2016-10-27T05:05:21+00:00\"}

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    9 years ago

    Thanks, that's helpful! We'll look into it.

     

    By the way, I've redacted it from your post, but for the sake of security, you should revoke that access token. You can do so by revoking access to the app entirel, here:

     

    https://www.dropbox.com/team/admin/team_apps

     

    (Note that that will revoke all access tokens for that team-app pair.)

  • Saar A.'s avatar
    Saar A.
    Explorer | Level 4
    9 years ago

    Thanks!

    By the way I have fimiliar problem with restore, I keep getting revert events

About Dropbox API Support and Feedback

Node avatar for Dropbox API Support and Feedback
Get help with the Dropbox API from fellow developers and experts.

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!