Events

OW
Last updated 16 days ago

The Get Events API lets you fetch the events of entry or exit of your users from your event enabled geofences. The API also lets you filter by user or geofence, or location and other options.

get
Get Events API

https://api.geospark.co/v1
/api/event/
This API is responsible for giving the list of events.
Request
Response
Headers
Api-Key
required
string
33223kjhdcscijhb5sdbsdmjsdcbj5f
Content-Type
required
string
application/json
Query Parameters
page_number
optional
integer
Returns the data in the page provided. A page will have a maximum of 10 entries. If the response returns an empty list in data field, it is safe to assume the pages are exhausted.
geofence_id
optional
string
Returns Events only for the given geofence_id. Input Data: 5bd2aee1eec1a50d8faf1293
location_id
optional
string
Used to check if there's an event associated with a particular location, identified by it's location_id. Input Data: 5bd2ab9deec1a50c7fa75581
event_type
optional
string
Filter by entry or exit type events. Input Data: entry or exit
200: OK
JSON
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"next_page": 2,
"pages": 2,
"prev_page": null,
"account_id": "5bbdd7a8eec1a511b246490d",
"events": [
{
"id": "5bfa9599eec1a50778901421",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a4feec1a50e738db301",
"location_id": "5bfa9595eec1a5077890141e",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:29:09.273"
},
{
"id": "5bfa959aeec1a50778901422",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a75eec1a50e738db302",
"location_id": "5bfa9595eec1a5077890141e",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:29:13.925"
},
{
"id": "5bfa985beec1a507c7a12711",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a4feec1a50e738db301",
"location_id": "5bfa9854eec1a507c7a1270e",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "exit",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
71.86793
]
},
"timezone_offset": "+0100",
"started_at": "2018-10-02T11:42:00.000",
"ended_at": "2018-10-02T07:27:08.000",
"created_at": "2018-11-25T12:40:52.981"
},
{
"id": "5bfa985ceec1a507c7a12712",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a75eec1a50e738db302",
"location_id": "5bfa9854eec1a507c7a1270e",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "exit",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
71.86793
]
},
"timezone_offset": "+0100",
"started_at": "2018-10-02T11:42:00.000",
"ended_at": "2018-10-02T07:27:08.000",
"created_at": "2018-11-25T12:40:59.632"
},
{
"id": "5bfa98efeec1a507f7b5b425",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a4feec1a50e738db301",
"location_id": "5bfa98eaeec1a507f7b5b422",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:43:22.679"
},
{
"id": "5bfa98f1eec1a507f7b5b426",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a75eec1a50e738db302",
"location_id": "5bfa98eaeec1a507f7b5b422",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:43:27.103"
},
{
"id": "5bfa992aeec1a507f7b5b435",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a4feec1a50e738db301",
"location_id": "5bfa98f1eec1a507f7b5b432",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "exit",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
71.86793
]
},
"timezone_offset": "+0100",
"started_at": "2018-10-02T11:42:00.000",
"ended_at": "2018-10-02T07:27:08.000",
"created_at": "2018-11-25T12:43:29.353"
},
{
"id": "5bfa992deec1a507f7b5b436",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a75eec1a50e738db302",
"location_id": "5bfa98f1eec1a507f7b5b432",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "exit",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
71.86793
]
},
"timezone_offset": "+0100",
"started_at": "2018-10-02T11:42:00.000",
"ended_at": "2018-10-02T07:27:08.000",
"created_at": "2018-11-25T12:44:26.586"
},
{
"id": "5bfa9961eec1a5080f9bb823",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a4feec1a50e738db301",
"location_id": "5bfa995ceec1a5080f9bb820",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:45:21.302"
},
{
"id": "5bfa9962eec1a5080f9bb824",
"user_id": "5bdad5f7eec1a507afa2fece",
"geofence_id": "5bc89a75eec1a50e738db302",
"location_id": "5bfa995ceec1a5080f9bb820",
"app_id": "5bbdd865eec1a511b246490e_1",
"event_type": "entry",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"recorded_at": "2018-10-02T10:44:00.000",
"timezone_offset": "+0100",
"created_at": "2018-11-25T12:45:22.602"
}
]
}
}

Sample Call

cURL
JavaScript
Python
Java
Swift
Go
curl -X GET \
'https://api.geospark.co/v1/api/event/?geofence_id=5bc89a4feec1a50e738db301&location_id=5bd2ab9deec1a50c7fa75581&event_type=entry&page_number=1' \
-H 'Api-Key: 2fd72b3b94b149018957eae89c2d1c86'