cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results forĀ 
ShowĀ Ā onlyĀ  | Search instead forĀ 
Did you mean:Ā 

events followed by api request

events followed by api request

Saar A.
Explorer | Level 4

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 8

Greg-DB
Dropbox Staff
I'm not sure I understand your question. What "event" exactly are you looking for from these API calls?

Saar A.
Explorer | Level 4

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

Greg-DB
Dropbox Staff

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.
Explorer | Level 4
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
Dropbox Staff
Can you share the specific steps to reproduce these issues, and some sample output showing them? Thanks in advance!

Saar A.
Explorer | Level 4

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
Dropbox Staff

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.
Explorer | Level 4

Thanks!

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

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    Saar A. Explorer | Level 4
  • User avatar
    Greg-DB Dropbox Staff
What do Dropbox user levels mean?