When we call the Events API, do we receive events that occur in the Box Sync app installed on the desktop, or do we only receive events that occur in the Box web browser?
Thanks,
Rona
When we call the Events API, do we receive events that occur in the Box Sync app installed on the desktop, or do we only receive events that occur in the Box web browser?
Thanks,
Rona
Hi @RonaFain
The event type sync
should pick those up.
Can you elaborate a bit more so I can try to reproduce your use case?
Cheers
Hi @rbarbosa !
Thanks for the quick response.
We’d like to track when users connect or use Box. We’ve observed that we’re not receiving information when users utilize the Box Sync app installed on their desktops.
When we make API calls and extract events with the event type “ITEM_SYNC”, we still aren’t getting this information.
Are there any other event types we should be looking at, or is there something else we need to define to capture this data?
Here’s what the API request looks like:
method: 'GET',
path: 'events',
qs: {
stream_type: 'admin_logs',
event_type: 'ADMIN_LOGIN', 'DOWNLOAD', 'ITEM_COPY', 'ITEM_CREATE', 'ITEM_DOWNLOAD',
'ITEM_OPEN', 'ITEM_SYNC', 'LOGIN', 'UPLOAD'
limit: 500,
created_after: since,
created_before: until,
stream_position: 0
}
Thanks
Hi @RonaFain,
This is a tricky one to replicate.
Let me explain how far I got, and please guide me to where you want to go, because that is not clear yet for me.
So far I’ve installed and configured Box Sync, please check if your version matches mine:
Also I’m using a similar query to yours to pull the events:
curl --location 'https://api.box.com/2.0/events?stream_type=admin_logs_streaming&stream_position=564646236770904&event_type=ADMIN_LOGIN%2CDOWNLOAD%2CITEM_COPY%2CITEM_CREATE%2CITEM_DOWNLOAD%2CITEM_OPEN%2CITEM_SYNC%2CLOGIN%2CUPLOAD' \
--header 'Authorization: Bearer Ow...ej'
Copying a file to the local folder, returns this event:UPLOAD
{
"entries": [
{
"source": {
"item_type": "file",
"item_id": "1323762426901",
"item_name": "OpenAI-Logo-PNG.png",
...
},
"created_by": {...},
"action_by": null,
"created_at": "2023-10-02T14:55:53-07:00",
"event_id": "1cface4f-c052-47dc-8331-3d26542119c3",
"event_type": "UPLOAD",
"ip_address": "73.106.125.0",
"type": "event",
"session_id": null,
"additional_details": {
"size": 66119,
"ekm_id": "e1861ec4-b7e5-486a-a0df-e62b23d9eae4",
"file_path": "/tmp",
"file_hash": "d9872b35c94455703bef4fa05603ced4c82c9cf3",
"hash_type": "sha1",
"version_id": "1448394575701",
"service_id": "5168",
"service_name": "Box Sync for Mac"
}
}
],
"chunk_size": 1,
"next_stream_position": 564646237181850
}
Restarting box Sync didn’t return any events.
Creating a text file: UPLOAD
{
"entries": [
{
"source": {
"item_type": "file",
"item_id": "1323763710842",
"item_name": "text.txt",
...
},
...
"action_by": null,
"created_at": "2023-10-02T15:01:59-07:00",
"event_id": "7b344c35-a62a-4ebe-ae9a-6bfeb1e5b57b",
"event_type": "UPLOAD",
"ip_address": "73.106.125.0",
"type": "event",
"session_id": null,
"additional_details": {
"size": 19,
"ekm_id": "238dfa79-46e8-47d6-84ad-5ebb23e4ff2f",
"file_path": "/tmp",
"file_hash": "a649bf201cde05724e48f2d397a615b201be34fb",
"hash_type": "sha1",
"version_id": "1448396375642",
"service_id": "5168",
"service_name": "Box Sync for Mac"
}
}
],
"chunk_size": 1,
"next_stream_position": 564646237560738
}
Creating a box note: UPLOAD, DOWNLOAD, ITEM_OPEN, DOWNLOAD
The ITEM_SYNC occurs when a folder is marked for sync.
For example, when I create a folder on this tmp folder, and then un-sync it, and then sync it, I get:
UPLOAD, ITEM_UNSYNC, ITEM_SYNC
{
"entries": [
{
"source": {
"item_type": "folder",
"item_id": "228868717769",
"item_name": "test folder",
"parent": {
"type": "folder",
"name": "tmp",
"id": "228854886866"
},
...
},
...
"action_by": null,
"created_at": "2023-10-02T15:11:27-07:00",
"event_id": "5d862521-e773-461c-bdfe-5a4400722da0",
"event_type": "UPLOAD",
"ip_address": "73.106.125.0",
"type": "event",
"session_id": null,
"additional_details": null
},
{
"source": {
"item_type": "folder",
"item_id": "228868717769",
"item_name": "test folder",
"parent": {
"type": "folder",
"name": "tmp",
"id": "228854886866"
},
...
},
...
"action_by": null,
"created_at": "2023-10-02T15:12:03-07:00",
"event_id": "a4f94f54-777b-42b3-b1af-a6c6e5fc58d5",
"event_type": "ITEM_UNSYNC",
"ip_address": "73.106.125.0",
"type": "event",
"session_id": null,
"additional_details": null
},
{
"source": {
"item_type": "folder",
"item_id": "228868717769",
"item_name": "test folder",
"parent": {
"type": "folder",
"name": "tmp",
"id": "228854886866"
},
...
},
...
"action_by": null,
"created_at": "2023-10-02T15:12:47-07:00",
"event_id": "048d7323-664c-47a2-a142-929dd1fad4c2",
"event_type": "ITEM_SYNC",
"ip_address": "73.106.125.0",
"type": "event",
"session_id": null,
"additional_details": null
}
],
"chunk_size": 3,
"next_stream_position": 564646238213586
}
Here you can find a complete list of events used on the box platform.
Can you elaborate on what are you trying to accomplish?
What is your end to end use case?
Best rregards
Rui
Thank you @rbarbosa for the response.
I just want to ensure that when a user connects to the Box Sync app installed on their desktop, we do not receive an event about it from the API, correct?
I’m not so sure about that…
But I don’t know when the Box sync actually logs in, for example it could be running on the background and not execute the login process, even after the computer has suspended, or not.
Either way, you wont get a consistent log, so probably is best to assume that it doesn’t than extrapolate.
Cheers