Webhook, Slack and Hangout Integration

OW
Last updated 5 days ago

Slack and hangout can be added in a similar fashion as we are integrating webhooks.

Below are the steps:

  • First login to GeoSpark dashboard, select a project or create one and add apps in it.

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

  • Go to settings tab in dashboard, where you will see options for webhook, slack and hangout integration. This again has an option which lets you choose which one you want to enable and actively use for subscription.

  • Now you can enable this feature by entering the respective URLs and please configure the same URL at your end for getting in your webhook, slack or hangout notifications.

  • NOTE : These are the URL's you create from your slack and hangout and put it in GeoSpark dashboard.

  • After integration you can monitor the users and geofence events.

Sample webhook url for notifications:

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

Response as input:

JSON
{
“geofence_id”:5bc89a4feec1a44e738db309”,
“geofence_description”: “Jane's Home”,
“project_id”:5bc25a4feec1a44e738db116”,
“event_type”: “entry”,
“user_id”:5bdad5f7eec1a507afa2fece”,
“user_description”: “Jane Doe”,
“recorded_at”:2018-11-23T10:27:32.000,
“event_id”:5bed5a6e878b1b00012xaec5”
}

OR

JSON
{
“geofence_id”:5bc89a4feec1a44e738db309”,
“geofence_description”: “Jane's Home”,
“project_id”:5bc25a4feec1a44e738db116”,
“event_type”: “exit”,
“user_id”:5bdad5f7eec1a507afa2fece”,
“user_description”: “Jane Doe”,
“recorded_at”:2018-11-23T10:28:32.000,
“event_id”:5bed5a6e878b1b00012xaec7”
}

Sample hangout url for notifications:

https://chat.googleapis.com/v1/spaces/AAAAXpwaM8c/messages?key=AIzaSyDdI0hCZtE6vySjMm-WEfRq3CPzqKqqsHI&token=Iagv0ff_1Gd4CQMVFQgNc5-6W3zBNJTaiOPO77kZ3KU%3D

Sample slack url for notifications:

https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX

Message format:

Text
Event Triggered:
Type: entry
User ID: 5bdad5f7eec1a507afa2fece
User Description: John Doe
Geofence ID: 5bc89a4feec1a44e738db309
Geofence Description: John Office
Recorded At: 2018-11-23T10:27:32.000
Event ID: 5bed5a6e878b1b00012xaec5

OR

Text
Event Triggered:
Type: exit
User ID: 5bdad5f7eec1a507afa2fece
User Description: John Doe
Geofence ID: 5bc89a4feec1a44e738db309
Geofence Description: John Office
Recorded At: 2018-11-23T10:28:32.000
Event ID: 5bed5a6e878b1b00012xaef6