InfraMarker uses websockets to send instant messages to our website, our phone app, or even your own applications. These messages or "events" are sent anytime an important action is executed on the server. There are two types of events: events sent to a user or set of users (multicast events), and events sent to any user that registers (broadcast events).
Each event has a name and data, sent as a JSON object. Example:
Event name:
project:creation_succeeded
Event data:
{
"user_id": 12,
"project_id": 123,
"job": "e08bc1b4-00b8-482d-b29f-191e6fe3e551"
}
Here's a list of all our websocket events:
Multicast events
project:creation_succeeded
- Sent when a project is created successfully.
- Includes: user id, project id, and asynchronous job hash.
- Receivers: all collaborators of the project (since it's a new project, just the owner).
project:deleted
- Sent when a project is deleted.
- Includes: user id, and project id.
- Receivers: all collaborators of the project.
project:metadata_updated
- Sent when any metadata of a project is updated (name, description, organization, etc.).
- Includes: user id, and project id.
- Receivers: all collaborators of the project.
project:process_file_started
- Sent when a file (uploaded or downloaded from a URL) starts processing.
- Includes: user id, project id, filename, and asynchronous job hash.
- Receivers: all collaborators of the project.
project:process_datasource_failed
- Sent when a file being processed (or one of the files, if a zip was uploaded) fails to load.
- Includes: user id, project id, filename, and asynchronous job hash.
- Receivers: all collaborators of the project.
project:process_file_finished
- Sent when a file (uploaded or downloaded from a URL) finishes processing.
- Includes: user id, project id, filename, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:creation_failed
- Sent when a dataset fails to create (either from a file or created using the schema editor).
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:creation_partial
- Sent when a dataset is created successfully, but some of the rows failed to load.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:creation_succeeded
- Sent when a dataset is created successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:deleted
- Sent when a dataset is deleted.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
dataset:metadata_updated
- Sent when any metadata of a dataset is updated (name, description, read-only flag, mobile flags, etc.).
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
dataset:style_updated
- Sent when the styling of a dataset is updated.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
dataset:table_updated
- Sent whenever the table of a dataset changes (either data changes or schema changes).
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
dataset:change_failed
- Sent when a change (submitted using the SubmitChange API endpoint) fails to be executed.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:change_succeeded
- Sent when a change (submitted using the SubmitChange API endpoint) is executed successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:export_failed
- Sent when a requested export fails to generated.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
dataset:export_succeeded
- Sent when a requested export is generated successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:creation_failed
- Sent when a raster dataset fails to create.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:creation_succeeded
- Sent when a raster dataset is created successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:deleted
- Sent when a raster dataset is deleted.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
raster_dataset:metadata_updated
- Sent when any metadata of a raster dataset is updated (name, description, etc.).
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
raster_dataset:style_updated
- Sent when the styling of a raster dataset is updated.
- Includes: user id, project id, and dataset id.
- Receivers: all collaborators of the project.
raster_dataset:export_failed
- Sent when a requested export fails to generated.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
raster_dataset:export_succeeded
- Sent when a requested export is generated successfully.
- Includes: user id, project id, dataset id, and asynchronous job hash.
- Receivers: all collaborators of the project.
base_layer:created
- Sent when a base layer is created.
- Includes: user id, project id, and base layer id.
- Receivers: all collaborators of the project.
base_layer:deleted
- Sent when a base layer is deleted.
- Includes: user id, project id, and base layer id.
- Receivers: all collaborators of the project.
user:invite_received
- Sent when a user is invited as a collaborator of a project.
- Includes: user id, project id, and permission level.
- Receivers: invited user.
user:accepted_invite
- Sent when a user accepts an invitation to join a project.
- Includes user id, and project id.
- Receivers: all collaborators of the project.
user:ignored_invite
- Sent when a user ignores an invitation to join a project.
- Includes user id, and project id.
- Receivers: all collaborators of the project.
user:left_project
- Sent when a user leaves a project.
- Includes user id, and project id.
- Receivers: all collaborators of the project.
user:metadata_updated
- Sent when a user updates his/her metadata (first name, last name, organization, etc.).
- Includes: user id.
- Receivers: involved user.
user:permission_changed
- Sent when the permission level of any of the collaborators of a project changes.
- Includes: user id, and project id.
- Receivers: all collaborators of the project.
user:linked_esri_credentials
- Sent when a user links his/her Esri ArcGIS account.
- Includes: user id.
- Receivers: involved user.
Broadcast events
realtime
- Related to realtime datasets. Sent when a new location (or group of locations) is reported for any of the tracked objects.
- Includes: dataset id and list of updated data (object id, timestamp, latitude & longitude, speed, climb, etc.).
- Receivers: any user registered to listen events.
What to do next?
As a next step I would recommend reading our different client implementations documentation (currently Python & Javscript) to see how to you can listen to these websocket events and add callbacks for each one of them:
Comments
0 comments
Please sign in to leave a comment.