Roam.ai Docs
HomeContactDashboard
  • Introduction
  • Getting Started
    • Key Concepts
  • Frameworks
  • Android
    • Quickstart (Android)
    • Pub/Sub Locations (Android)
    • SDK Methods (Android)
      • SDK Configuration (Android)
      • Get Current Location (Android)
      • Update Current Location (Android)
      • Update Location When Stationary (Android)
      • Trip v1 SDK Methods (Android)
      • Trip v2 SDK Methods (Android)
        • Create Trip (Android)
        • Update Trip (Android)
        • Start Quick Trip (Android)
        • Start Trip (Android)
        • End Trip (Android)
        • Pause Trip (Android)
        • Resume Trip (Android)
        • Sync Trip (Android)
        • Get Trip (Android)
        • Get Active Trips (Android)
        • Get Trip Summary (Android)
        • Subscribe to Trip (Android)
        • Delete Trip (Android)
    • Utility Methods (Android)
    • Troubleshooting (Android)
    • Changelog (Android)
  • iOS
    • Quickstart (iOS)
    • Pub/Sub Locations (iOS)
    • SDK Methods (iOS)
      • SDK Configuration (iOS)
      • Get Current Location (iOS)
      • Update Current Location (iOS)
      • Update Location When Stationary (iOS)
      • Trips v1 SDK Methods (iOS)
      • Trips v2 SDK Methods (iOS)
        • Create Trip (iOS)
        • Update Trip (iOS)
        • Start Quick Trip (iOS)
        • Start Trip (iOS)
        • End Trip (iOS)
        • Pause Trip (iOS)
        • Resume Trip (iOS)
        • Sync Trip (iOS)
        • Get Trip (iOS)
        • Get Active Trips (iOS)
        • Get Trip Summary (iOS)
        • Subscribe Trip (iOS)
        • Delete Trip (iOS)
    • Utility Methods (iOS)
    • Troubleshooting (iOS)
    • Changelog (iOS)
  • React Native
  • Flutter
  • PRODUCTS
  • Tracking (BETA)
  • Geofencing
  • Trips
  • APIs
    • Authorization
    • Users API
      • Create User API
      • Get User API
      • Update User API
    • Locations API
      • Get Locations API
      • Get Stop Locations API
    • Insights API
      • Get User POIs API
      • Get User Home Location API
      • Get User Work Location API
    • Trips v1 API
      • Create Trip API v1
      • Get Trip API
      • Update Trip API v1
      • Delete Trip API v1
      • Trip Summary API
      • Export Trip Summary as GPX
    • Trips v2 API
      • Create Trip API
      • Get Single Trip API
      • Get Multiple Trips API
      • Update Trip API
      • Control Trip API
        • Start Trip API
        • Pause Trip API
        • Resume Trip API
        • End Trip API
      • Get Trip Summary API
      • Export Trip API
      • Delete Trip API
    • Geofencing API
      • CREATE Geofence API
      • GET Geofence API
      • UPDATE Geofence API
      • DELETE Geofence API
    • Events API
      • Get Events
      • Trip Events
    • Nearby API
      • Get Nearby User API
      • Get Nearby Geofence API
    • Moving Geofence API
      • Create Moving-Geofence API
      • Update Moving-Geofence API
      • GET Moving-Geofence API
      • Delete Moving-Geofence API
    • User Groups API
      • Create Group API
      • Get User Group by ID
      • Get User Group List
      • Add Users to Group API
      • Update Group API
      • Find Nearby Users from Group
    • Query with Metadata
  • WEBHOOK
    • Webhook
    • Slack Integration
  • LIBRARIES
    • Javascript Library
    • Go Library
    • Python Library
Powered by GitBook
On this page
  • How to setup Webhooks on the Roam Dashboard?
  • Sample Webhook URL for notifications:

Was this helpful?

Export as PDF
  1. WEBHOOK

Webhook

Unlike traditional methods where one system constantly polls another system for information, Webhooks ensures that data is sent automatically when an event occurs.

PreviousQuery with MetadataNextSlack Integration

Last updated 3 years ago

Was this helpful?

How to setup Webhooks on the Roam Dashboard?

  • First, login to the Roam dashboard -> Select a project or create one and add apps to it.

  • Add geofences for that project from the Roam geofence page accessible via the top navigation tabs. Enable the geofence status for triggering events whenever the user using your app enters or exits the geofence.

  • Go to the settings tab on the dashboard. Under the Webhooks section, you will see options for Webhooks and Slack integration. There is a provision to enable either Webhooks or Slack integration to subscribe to the user events from the server-side. You can also test these events by selecting an event to test at the given endpoint.

  • You can now enable this feature by entering the respective URLs. Remember to configure the same URL at your end to receive Webhook or Slack notifications.

NOTE: These are the URLs you create from your Slack and put in the Roam dashboard.

  • After integration, you can monitor the user locations, geofence and trip events.

Each POST request will consist of any one of the three objects.

  1. Event - To notify geofence entry and exit events.

  2. User - To notify user movement updates with respect to user activity. ie. Stop “S”, Moving “M”.

  3. Trip - To notify trip start and end.

You can also receive real-time location events client-side via the SDK with didUpdateLocation() which has less latency.

Sample Webhook URL for notifications:

https://www.example.com/< YOUR-WEBHOOK-ENDPOINT >

Response as input:

  {
  "event":  [
    {
      "user_id": "60b08d4f51efb00609f9afb1",
      "location_id": "60b08d5f1b9e3900007afb07",
      "geofence_id": "60af36958ce7db2395eb7a87",
      "recorded_at": "2021-05-28T06:27:43.080Z",
      "event_source": "geospark:geofence",
      "event_version": "1.0",
      "event_type": "geospark:geofence:Exit",
      "location": {
        "type": "Point",
        "coordinates": [
          85.06905784228388,
          25.605483727570086
        ]
      },
      "speed": 0,
      "course": 83.14997873855464,
      "altitude": 56.562080901085935,
      "activity": "M",
      "vertical_accuracy": null,
      "horizontal_accuracy": 88.64567615715366
    }
  ]
},
   {
  "coordinates":
   {
    "type": "Point",
    "coordinates": [
      85.06905784228388,
      25.605483727570086
    ]
  },
  "location_id": "60b08d5f1b9e3900007afb07",
  "recorded_at": "2021-05-28T06:27:43.080Z",
  "user_id": "60b08d4f51efb00609f9afb1",
  "event_version": "1.0",
  "event_source": "geospark:location",
  "event_type": "geospark:location:point",
  "speed": 0,
  "course": 83.14997873855464,
  "altitude": 56.562080901085935,
  "activity": "M",
  "vertical_accuracy": 71.87669804650587,
  "horizontal_accuracy": 88.64567615715366
},
 {
  "events": [
    {
      "user_id": "60b08d4f51efb00609f9afb1",
      "location_id": "60b08de376886500001e6827",
      "trip_id": "60b08da506f8a07362ca08bd",
      "trip_location_id": "60b08da506f8a07362ca08be",
      "recorded_at": "2021-05-28T06:29:55.729Z",
      "event_source": "geospark:trip",
      "event_version": "1.0",
      "event_type": "geospark:trip:reached_origin",
      "location": {
        "type": "Point",
        "coordinates": [
          85.0692907329729,
          25.605278502615263
        ]
      },
      "speed": 0,
      "course": -1,
      "altitude": 55.64597914647311,
      "activity": "S",
      "vertical_accuracy": null,
      "horizontal_accuracy": 5.027652817850262
    }
  ]
}