You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Xalbat
4 years agoExplorer | Level 4
team_log/get_events sometimes missing the last event
I can't figure out the exact circumstances, but sometimes, when sending a team_log/get_events request, the latest event is missing in the answer.
We are using Dropbox's webhook system to get notified whenever a new event is triggered. When we get notified, we use the team_log/get_events endpoint to retrieve the events. But we noticed that sometimes, the last event is missing from the answer and every following requests to the endpoint will have the same issue.
So as a test, I added and deleted a new text file from Dropbox. When the webhook have been triggered, I sent two consecutive requests.
Here is the answer I got when sending the first request : (We only get the Add event with the has_more boolean as false)
Spoiler
{
"events": [
{
"timestamp": "2021-11-17T14:40:17Z",
"event_category": { ".tag": "file_operations" },
"actor": {
".tag": "admin",
"admin": {
".tag": "team_member",
"account_id": "dbid:AAA4IxcQI59v7ONmxBTvJuVN7iMmLEAR3IY",
"display_name": "Xalbat Echeverria",
"email": "xecheverria@isdecisions.com",
"team_member_id": "dbmid:AAAAlVKFr0jmMrY1FT_1Wbh-1LJUJrxuHwM"
}
},
"origin": {
"geo_location": {
"city": "Anglet",
"region": "Nouvelle-Aquitaine",
"country": "FR",
"ip_address": "185.182.168.24"
},
"access_method": {
".tag": "end_user",
"end_user": {
".tag": "desktop",
"session_id": "dbdsid:AACbqF35lbBz44w8my11bsfQsldXapES9Ro"
}
}
},
"involve_non_team_member": false,
"context": {
".tag": "team_member",
"account_id": "dbid:AAA4IxcQI59v7ONmxBTvJuVN7iMmLEAR3IY",
"display_name": "Xalbat Echeverria",
"email": "xecheverria@isdecisions.com",
"team_member_id": "dbmid:AAAAlVKFr0jmMrY1FT_1Wbh-1LJUJrxuHwM"
},
"participants": [],
"assets": [
{
".tag": "file",
"path": {
"contextual": "/Test X/New Text Document.txt",
"namespace_relative": {
"ns_id": "1861968209",
"relative_path": "/New Text Document.txt",
"is_shared_namespace": true
}
},
"display_name": "New Text Document.txt",
"file_id": "id:rb8b75y3ODAAAAAAAAAAOQ"
}
],
"event_type": {
".tag": "file_add",
"description": "Added files and/or folders"
},
"details": { ".tag": "file_add_details" }
}
],
"cursor": "AAD1hlUH-xf6DZe2MVFmdviIy9iTIcTIN-L_yRSGJRcdX8As3Wxr9pzJI722iiBOa9isB-nixKAbK3jYtK0k_Q-jU_vMAS4zPMbGpf-EnhrcKYsIgMNmkXXhMq6hokr_1Ma8EhfSDU7Pd4qiAFWGDC0Fao83Tx9iSkRhnmrKv2xP-O8paIkLxnzzmU1AWho6JOnN_jxQ--CxLoTu67zBdzA6kFD_s41n22anmHIPQhllnvs_o3XjnBdJM6amGjyvhN7-bSpQkcK-nkIsBJkw1SMOnDcNhaPopc70mYSsPuZahOwiUN_XzKyYukrF6YzxGW8rMOF3Qj2eZlXABoYF1sKt-8sn0YqileQdtc_lhpK3BGZ4ldbl5o-Lbd-M76oGIJuQz041wL-NrOD7QjMq1lUTwzpa1RBwpLWrUKigl3BmXA",
"has_more": false
}
And here is the answer to the following request : (This time we get the Delete event)
Spoiler
{
"events": [
{
"timestamp": "2021-11-17T15:11:14Z",
"event_category": { ".tag": "file_operations" },
"actor": {
".tag": "admin",
"admin": {
".tag": "team_member",
"account_id": "dbid:AAA4IxcQI59v7ONmxBTvJuVN7iMmLEAR3IY",
"display_name": "Xalbat Echeverria",
"email": "xecheverria@isdecisions.com",
"team_member_id": "dbmid:AAAAlVKFr0jmMrY1FT_1Wbh-1LJUJrxuHwM"
}
},
"origin": {
"geo_location": {
"city": "Anglet",
"region": "Nouvelle-Aquitaine",
"country": "FR",
"ip_address": "185.182.168.24"
},
"access_method": {
".tag": "end_user",
"end_user": {
".tag": "desktop",
"session_id": "dbdsid:AACbqF35lbBz44w8my11bsfQsldXapES9Ro"
}
}
},
"involve_non_team_member": false,
"context": {
".tag": "team_member",
"account_id": "dbid:AAA4IxcQI59v7ONmxBTvJuVN7iMmLEAR3IY",
"display_name": "Xalbat Echeverria",
"email": "xecheverria@isdecisions.com",
"team_member_id": "dbmid:AAAAlVKFr0jmMrY1FT_1Wbh-1LJUJrxuHwM"
},
"participants": [],
"assets": [
{
".tag": "file",
"path": {
"contextual": "/Test X/New Text Document.txt",
"namespace_relative": {
"ns_id": "1861968209",
"relative_path": "/New Text Document.txt",
"is_shared_namespace": true
}
},
"display_name": "New Text Document.txt",
"file_id": "id:rb8b75y3ODAAAAAAAAAAOQ",
"file_size": 0
}
],
"event_type": {
".tag": "file_delete",
"description": "Deleted files and/or folders"
},
"details": { ".tag": "file_delete_details" }
}
],
"cursor": "AACaqNQXMiNfSfGwmBwHHBAtVAcP5r4hg_UsGdbxee-7Cdsz1dmer-iSfAlHC51QavOj4tlYvJE7z1saP9EPNSeFd1EwHsjZ84o_8iPQHhQOzf9L02LryljIb58Yd01JxBjk9rEWKY_lZuDytd21pHAXBZ-pO3XAMRn7rSin-G6kol-YJ1hQHbrIvat8HWan474TFtlK6TCArPWbgSuevZGRyitwT5YcBN_U-IPWkzjMuKgZQoLl2MlkXGuiGlAHpEIB1rOfT0Ni5yWHQwsjjJzfvpq5Ds83OGfr-8VE37tTizrmbL_MM4hWXk3QT1R2Hs1lFEWtedsx4siDS78K7B2PeiFE38eaFptW4zgO7uJ8Z2AJ7hao7YmTOlzVJGSwBQSJoV-_uCE34UfIi7bVEb4R9iUSEewZIjP5CIkATKZbdw",
"has_more": false
}
I don't understand why sometimes the last event is missing, and it is causing us some troubles with applications that are in production.
Is this a known issue ? Am I missing something ?
Tell me if you need any more infos.
Apologies for the lack of response here! (I wasn't notified of this post for some reason.)
Anyway, it can take some time to propagate events to the /2/team_log/get_events[/continue] results, so you may not always see the latest results immediately. So, in some cases like this, you may call before all of the latest events are available. If you're seeing this happen regularly and it's causing issues for your app, you may want to add a delay between receiving the webhook notification and calling /2/team_log/get_events[/continue].
- Greg-DBDropbox Staff
Apologies for the lack of response here! (I wasn't notified of this post for some reason.)
Anyway, it can take some time to propagate events to the /2/team_log/get_events[/continue] results, so you may not always see the latest results immediately. So, in some cases like this, you may call before all of the latest events are available. If you're seeing this happen regularly and it's causing issues for your app, you may want to add a delay between receiving the webhook notification and calling /2/team_log/get_events[/continue].
- XalbatExplorer | Level 4
Hello Greg-DB,
Sorry for the delayed answer, I had to work on another project for the last week.
As a temporary solution, we'll delay all of our requests to this endpoint. But I have to tell that this behaviour is a bit strange.
Dropbox notifies us of a new event, though the API can't tell us straight away what this event is.
I understand there surely are some limitations on your side, but is this something your team is looking to fix in the future ?
It would surely be way more practical if notifications and data were synchronized.
- Greg-DBDropbox Staff
Thanks for the feedback! I can't make any promises, but I'll bring this up with the team to see if we can improve this in the future.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,882 PostsLatest Activity: 3 hours agoIf 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 or Facebook.
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!