#API

This page describes GeoSpark authentication model, API endpoints and error handling while using GeoSpark APIs.

#Quick Start

GeoSpark provides a set of REST API that lets you get, update, and delete your already created users, events, location, trips and Geofences, which will help you to do more with our product.


#Base URL

All URLs referenced in the API documentation will have the base:

REST APIs are served over HTTPS. To ensure data privacy, GeoSpark discourage using unencrypted HTTP requests.


https://api.geospark.co/v1

#API Use Cases

Here are some popular use cases with GeoSpark APIs:

  • Can be used to view and do much more with your user data.
    • Enables you to view user count per project.
    • Enables you to determine the device(iOS/Android) and application from which the hits are coming from.
  • Can create, update, and delete Geofences, and trigger events on the fly
    • Use geofences to create virtual for your structural properties on maps.
    • Track your users as they enter and exit geofences.
    • Understand user behaviour and usage, as well as visit patterns.
  • Locations APIs for tracking your users movement and activities.
    • Know the users location in real time by just calling GeoSpark APIs.
  • Trips APIs can be used to view your user trips and routes
    • Track the trip of the user.
    • Fetch path of the trips along with the routes,mode of transportation, stop points and offline status.

#Authentication

GeoSpark use a basic authentication for the APIs taking into consideration the safety of your API secret keys. We provide APIs on a per project basis so that the projects are independent of each other's APIs.

#API Endpoints

Once your application is integrated with GeoSpark SDK, account for each user using your app will be created. Information about these users can be tracked through GeoSpark APIs.

Here are the API endpoints available to interact with the user profile data:

  • Users
  • Events
  • Trips
  • Geofences

#Users

The Get User API lets you fetch user data chronologically. The Get Location API lets you fetch user location data chronologically.

  • Pass your secret API key in the header
  • API parameter page_number, gives a maximum of 10 entries per page in response
  • app_platform represents device platform , i.e. "1" for android and "2" for iOS
  • For list APIs the "next_page" and "prev_page" fields will be "null" if not present. and "pages" will be 0 if not present.

#Get User API

Get User API provides the list of users who are using your app corresponding to the project secret API key provided by you.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id Optional string For searching a particular user.
Note: Use this field for only searching. No other field should be combined with it.
E.g. /api/user/?user_id=5c2f43e8fb979679beba0cce
Input Data: 5bd2aee1eec1a55d8faf1193
timezone_offset Optional string If timezone is provided then the response will be returned as per provided local timezone. If the timezone is not passed, response will be returned in UTC.
Input Data: Asia/Kolkata
start_date Optional string This field can be used for defining a start date from which the list of users needs to shown.
Input Data: 2018-10-19
end_date Optional string This field can be used to define a range of time till when the last document needs to be provided. 'end_date' should always be greater than 'start_date'. If end_date is provided then start_date should also be provided. If only start_date is passed, the user list for same day will be returned.
Input Data: 2018-10-20
page_number Optional string This field can be used for getting 10 entries at a time. if the response returns an empty list in data field, it is safe to assume the pages are exhausted.

https://api.geospark.co/v1/api/user/

            
//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": {
      "next_page": null,
      "pages": 1,
      "prev_page": null,
      "account_id": "5d15e6029694061560ed8d64",
      "users": [
          {
              "id": "5d947b80e47bae6d700650cd",
              "app_id": "5d15e65a9694061560ed8de7_1",
              "device_token": "c6IDEE9eq7A:APA91bEg_q3zDuKNmlwIsSdDAdycCxrM-xGA8FcCRwIrTt5gCXCbAQWg2pUc25dB_-MbWeBrEEtgkCN0lbkwjuqNhls7pDotBSzdHTsyLOPVJ8i2dnrGSWj8aLHHYwCkX5xRCey2SeEe",
              "device_uuid": "51ad2d53-9057-49c3-93cf-a4817045bf48",
              "description": "James",
              "brand": "asus",
              "model": "ASUS_Z012DB",
              "os_version": "26",
              "sdk_version": "2.1.1",
              "device_arn": "arn:aws:sns:us-east-1:218937252071:endpoint/GCM/app_5d15e65a9694061560ed8de7_1_ddba9c68-dee2-4e33-8258-ff7f7515a672/4f497606-3ae6-3c1d-99f6-a015af4fd42d",
              "geofence_events": true,
              "motion_events": true,
              "trips_events": true,
              "is_deleted": false,
              "created_at": "2019-10-02T15:57:11.970",
              "last_location_update": {
                  "id": "5d947b82e47bae6d700650ce",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.6354213,
                          12.9143926
                      ]
                  },
                  "speed": 0.0,
                  "accuracy": 26.04800033569336,
                  "altitude": 795.8999633789062,
                  "activity": "WALK",
                  "recorded_at": "2019-10-02T10:27:14.053",
                  "timezone_offset": "+0530",
                  "net_stat": true,
                  "gps_stat": true,
                  "motion_stat": true,
                  "app_stat": "MANUAL",
                  "battery_remaining": 57,
                  "bat_stat": "Unknown",
                  "bat_saver_mode": false,
                  "location_permission": true,
                  "airplane_mode": false,
                  "created_at": "2019-10-02T10:27:14.256"
              }
          },
          {
              "id": "5d94703396940667bc0a1732",
              "app_id": "5d15e65a9694061560ed8de7_1",
              "device_token": "d1QlKpq-QJU:APA91bFCKZIG3Ypi6n6Z5zZyo6w-E0ZJg6GRxoT7aImxURvlFDtlRkGllykc6g3kW7C0aPDYN2L8ouMr--WVDrJA3tU0pHRA-ENuNc0PIZUqipqKNfmq4NfELNGIjzRGJPtypK0PIKIs",
              "device_uuid": "3da30854-1525-48a8-812d-bb17c797df47",
              "description": "sujith",
              "brand": "samsung",
              "model": "SM-G950F",
              "os_version": "28",
              "sdk_version": "2.1.1",
              "device_arn": "arn:aws:sns:us-east-1:218937252071:endpoint/GCM/app_5d15e65a9694061560ed8de7_1_ddba9c68-dee2-4e33-8258-ff7f7515a672/76560c7e-dfed-3b0f-85a8-8df5b7d75e19",
              "geofence_events": true,
              "motion_events": true,
              "trips_events": true,
              "is_deleted": false,
              "created_at": "2019-10-02T15:08:59.020",
              "last_location_update": {
                  "id": "5d94703596940667bc0a1736",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.6353995,
                          12.9144113
                      ]
                  },
                  "speed": 0.0,
                  "accuracy": 28.9419994354248,
                  "altitude": 795.899963378906,
                  "activity": "STOP",
                  "address": "GeoSpark, 164, 9th Main Road, Sector 5, HSR Layout Ward, Bommanahalli Zone, Bengaluru, Bangalore Urban, Karnataka, 560102, India"
                  "timezone_offset": "+0530",
                  "started_at": "2019-10-02T09:38:59.883",
                  "ended_at": "2019-10-02T09:39:00.512",
                  "net_stat": true,
                  "gps_stat": true,
                  "motion_stat": true,
                  "app_stat": "FOREGROUND",
                  "battery_remaining": 94,
                  "bat_stat": "Unknown",
                  "bat_saver_mode": false,
                  "location_permission": true,
                  "airplane_mode": false,
                  "created_at": "2019-10-02T09:39:01.371"
              }
          }
      ]
  }
}

#Get Location API

Get Location API provides the list of locations of the users who are using your app for a specified project corresponding to the project secret API key provided by you.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id REQUIRED string Filters the location data for the given user_id.
Input Data: 5bd2aee1eec1a55d8faf1193
timezone_offset Optional string If timezone is provided then the response will be returned as per provided local timezone. If the timezone is not passed, response will be returned in UTC. If points_encoded value is true, then this value will be UTC by default.
Input Data: Asia/Kolkata
start_date Optional string This field can be used for defining a start date from which the list of users's locations needs to shown.
Input Data: 2018-10-19
end_date Optional string This field can be used to define a range of time till when the last document needs to be provided. 'end_date' should always be greater than 'start_date'. If end_date is provided then start_date should also be provided. If only start_date is passed, the user list for same day will be returned.
Input Data: 2018-10-20
page_number Optional string This field can be used for getting 10 entries at a time. If the response returns an empty list in data field, it is safe to assume the pages are exhausted. If points_encoded value is true, then this value will not be considered.
points_encoded Optional boolean This field can be used to get the location data in encoded polyline and time aware polyline. This will be false by default.

https://api.geospark.co/v1/api/location/

          
//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": {
      "next_page": 2,
      "pages": 15,
      "prev_page": null,
      "app_id": "5d68c56255c9d50640802ff8_2",
      "user_id": "5d931e4896940667bc0834dd",
      "locations": [
          {
              "id": "5d93696096940667bc0893fe",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63033406133458,
                      13.01788769586474
                  ]
              },
              "speed": 0.0,
              "accuracy": 10.0,
              "altitude": 897.4580940078257,
              "activity": "STOP",
              "address": "GeoSpark, 164, 9th Main Road, Sector 5, HSR Layout Ward, Bommanahalli Zone, Bengaluru, Bangalore Urban, Karnataka, 560102, India"
              "timezone_offset": "+0530",
              "started_at": "2019-10-01T14:57:05.444",
              "ended_at": "2019-10-01T14:57:35.986",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 98,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:57:36.300"
          },
          {
              "id": "5d93692b96940667bc08939a",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63077092364209,
                      13.017818061647022
                  ]
              },
              "speed": 18.0,
              "accuracy": 5.0,
              "altitude": 902.267219543457,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:56:43.420",
              "recorded_at": "2019-10-01T14:56:43.092"
          },
          {
              "id": "5d93690396940667bc089332",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63258644386906,
                      13.017401564878428
                  ]
              },
              "speed": 20.0,
              "accuracy": 5.0,
              "altitude": 902.8652420043945,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:56:03.421",
              "recorded_at": "2019-10-01T14:56:03.078"
          },
          {
              "id": "5d9368e196940667bc0892e5",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63434211730737,
                      13.016522638511859
                  ]
              },
              "speed": 22.0,
              "accuracy": 10.0,
              "altitude": 907.4284744262695,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:55:29.285",
              "recorded_at": "2019-10-01T14:55:29.082"
          },
          {
              "id": "5d9368ca96940667bc0892b9",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63618052012998,
                      13.01624611952623
                  ]
              },
              "speed": 15.0,
              "accuracy": 5.0,
              "altitude": 909.6889724731445,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:55:06.267",
              "recorded_at": "2019-10-01T14:55:06.081"
          },
          {
              "id": "5d93688f96940667bc089232",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.6364021391822,
                      13.017499802693466
                  ]
              },
              "speed": 23.0,
              "accuracy": 10.0,
              "altitude": 908.5708084106445,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:54:07.437",
              "recorded_at": "2019-10-01T14:54:07.086"
          },
          {
              "id": "5d93686de47bae6d7004c5d3",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63686545491203,
                      13.01945139072632
                  ]
              },
              "speed": 19.0,
              "accuracy": 10.068562831803998,
              "altitude": 909.973518371582,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:53:33.295",
              "recorded_at": "2019-10-01T14:53:33.091"
          },
          {
              "id": "5d93684596940667bc0891b4",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63702449676983,
                      13.021435016003837
                  ]
              },
              "speed": 10.0,
              "accuracy": 11.166095059679792,
              "altitude": 910.216194152832,
              "activity": "DRIVE",
              "timezone_offset": "+0530",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:52:53.272",
              "recorded_at": "2019-10-01T14:52:53.101"
          },
          {
              "id": "5d93680ae47bae6d7004c4c5",
              "coordinates": {
                  "type": "Point",
                  "coordinates": [
                      77.63657012402616,
                      13.02296174115325
                  ]
              },
              "speed": 0.0,
              "accuracy": 10.0,
              "altitude": 902.1354044576965,
              "activity": "STOP",
              "address": "GeoSpark, 164, 9th Main Road, Sector 5, HSR Layout Ward, Bommanahalli Zone, Bengaluru, Bangalore Urban, Karnataka, 560102, India"
              "timezone_offset": "+0530",
              "started_at": "2019-10-01T14:51:23.087",
              "ended_at": "2019-10-01T14:51:53.976",
              "net_stat": true,
              "gps_stat": true,
              "motion_stat": true,
              "app_stat": "BACKGROUND",
              "battery_remaining": 97,
              "bat_stat": "Charging",
              "created_at": "2019-10-01T14:51:54.176"
          }
      ]
  }
}

#Update User API

This API lets you enable or disable the events for the given user_id.

Request

Path Parameters

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id REQUIRED string User id which need to be updated.
timezone_offset Optional string If timezone is provided then the response will be returned as per provided local timezone. If the timezone is not passed, response will be returned in UTC. If points_encoded value is true, then this value will be UTC by default.
Input Data: Asia/Kolkata
motion_events Optional boolean Turn on/off events for change in activity.
geofence_events Optional boolean Turn on/off geofence events.
trips_events Optional boolean Turn on/off trips events.

https://api.geospark.co/v1/api/user/

        
//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": {
      "id": "5d948d735f37c615833719d2",
      "account_id": "5d01de8aaa6ad90610ac7aaf",
      "app_id": "5d948d61670dc805827b09b5_2",
      "device_token": "devicetoken",
      "device_uuid": null,
      "description": "postman device test",
      "brand": "Samsung",
      "model": "S8",
      "group_id": null,
      "os_version": "8.1",
      "sdk_version": "2.1",
      "device_arn": null,
      "geofence_events": true,
      "motion_events": true,
      "trips_events": true,
      "metadata": null,
      "is_deleted": false,
      "created_at": "2019-10-02T11:43:47.765",
      "updated_at": "2019-10-02T12:20:34.749"
  }
}

#Trips

The Get Trips API lets you fetch the trips data of all active ongoing and completed trips for your users.

#Get Trips List API

The Get Trips list API lets you fetch the list of all trips data of all active ongoing and completed trips for your users.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id Optional string Filters the trips data for the given user_id.
start_date Optional string This field can be used for defining a start date from which the list of users needs to shown.
Input Data: 2018-10-19
end_date Optional string This field can be used to define a range of time till when the last document needs to be provided. 'end_date' should always be greater than 'start_date'. If end_date is provided then start_date should also be provided. If only start_date is passed, the user list for same day will be returned.
Input Data: 2018-10-20
page_number Optional integer This field can be used for getting 10 entries at a time. if the response returns an empty list in data field, it is safe to assume the pages are exhausted.

https://api.geospark.co/v1/api/trips/

  
//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": {
      "next_page": null,
      "pages": 1,
      "prev_page": null,
      "trips": [
          {
              "id": "5d946bc45f37c6157d371d8f",
              "project_id": "5d930b99670dc8057b7b0eb3",
              "origins": [
                  {
                      "id": "5d946bc45f37c6157d371d90",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "created_at": "2019-10-02T09:20:04.232",
                      "updated_at": "2019-10-02T09:20:11.730",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.622977,
                              12.917042
                          ]
                      },
                      "reached": true,
                      "left": true,
                      "loc_type": "origin"
                  },
                  {
                      "id": "5d946bc45f37c6157d371d91",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "created_at": "2019-10-02T09:20:04.245",
                      "updated_at": "2019-10-02T09:20:16.638",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.650239,
                              12.924304
                          ]
                      },
                      "reached": true,
                      "left": true,
                      "loc_type": "origin"
                  },
                  {
                      "id": "5d946bc45f37c6157d371d92",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "created_at": "2019-10-02T09:20:04.257",
                      "updated_at": "2019-10-02T09:20:16.710",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.743206,
                              12.954302
                          ]
                      },
                      "reached": true,
                      "loc_type": "origin"
                  }
              ],
              "destinations": [
                  {
                      "id": "5d946bc45f37c6157d371d93",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "created_at": "2019-10-02T09:20:04.269",
                      "updated_at": "2019-10-02T09:20:04.274",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              78.743206,
                              12.954302
                          ]
                      },
                      "reached": false,
                      "loc_type": "destination"
                  }
              ],
              "events": [
                  {
                      "id": "5d946bc45f37c6157d371d94",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:created",
                      "created_at": "2019-10-02T09:20:04.287",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bc6670dc8057b7b1094",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946bc45f37c6157d371d90",
                      "user_location_id": "5d946bc6670dc8057b7b1092",
                      "created_at": "2019-10-02T09:20:06.707",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bc95f37c615833719a1",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:started",
                      "user_location_id": "5d946bc95f37c6158337199f",
                      "created_at": "2019-10-02T09:20:09.523",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bcb670dc805807b0b99",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:user_left_origin",
                      "trip_location_id": "5d946bc45f37c6157d371d90",
                      "user_location_id": "5d946bcb670dc805807b0b97",
                      "created_at": "2019-10-02T09:20:11.735",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bce5f37c6157d371d97",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946bc45f37c6157d371d91",
                      "user_location_id": "5d946bce5f37c6157d371d95",
                      "created_at": "2019-10-02T09:20:14.099",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bd0670dc8057b7b1097",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:user_left_origin",
                      "trip_location_id": "5d946bc45f37c6157d371d91",
                      "user_location_id": "5d946bd0670dc8057b7b1095",
                      "created_at": "2019-10-02T09:20:16.643",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946bd0670dc8057b7b1098",
                      "trip_id": "5d946bc45f37c6157d371d8f",
                      "user_id": "5d946b665f37c6158337199e",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946bc45f37c6157d371d92",
                      "user_location_id": "5d946bd0670dc8057b7b1095",
                      "created_at": "2019-10-02T09:20:16.710",
                      "is_deleted": false
                  }
              ],
              "user_id": "5d946b665f37c6158337199e",
              "is_started": true,
              "is_ended": false,
              "is_deleted": false,
              "trip_started_at": "2019-10-02T09:20:09.229",
              "is_paused": false,
              "created_at": "2019-10-02T09:20:04.229",
              "updated_at": "2019-10-02T09:20:16.718"
          },
          {
              "id": "5d946b545f37c6157d371d86",
              "project_id": "5d930b99670dc8057b7b0eb3",
              "origins": [
                  {
                      "id": "5d946b545f37c6157d371d87",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "created_at": "2019-10-02T09:18:12.400",
                      "updated_at": "2019-10-02T09:18:22.777",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.622977,
                              12.917042
                          ]
                      },
                      "reached": true,
                      "left": true,
                      "loc_type": "origin"
                  },
                  {
                      "id": "5d946b545f37c6157d371d88",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "created_at": "2019-10-02T09:18:12.411",
                      "updated_at": "2019-10-02T09:18:27.624",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.650239,
                              12.924304
                          ]
                      },
                      "reached": true,
                      "loc_type": "origin"
                  },
                  {
                      "id": "5d946b545f37c6157d371d89",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "created_at": "2019-10-02T09:18:12.423",
                      "updated_at": "2019-10-02T09:18:27.691",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              77.743206,
                              12.954302
                          ]
                      },
                      "reached": true,
                      "left": true,
                      "loc_type": "origin"
                  }
              ],
              "destinations": [
                  {
                      "id": "5d946b545f37c6157d371d8a",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "created_at": "2019-10-02T09:18:12.434",
                      "updated_at": "2019-10-02T09:18:12.438",
                      "coordinates": {
                          "type": "Point",
                          "coordinates": [
                              78.743206,
                              12.954302
                          ]
                      },
                      "reached": false,
                      "loc_type": "destination"
                  }
              ],
              "events": [
                  {
                      "id": "5d946b545f37c6157d371d8b",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:created",
                      "created_at": "2019-10-02T09:18:12.451",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b5a670dc805807b0b91",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946b545f37c6157d371d87",
                      "user_location_id": "5d946b5a670dc805807b0b8f",
                      "created_at": "2019-10-02T09:18:18.087",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b5c5f37c6158337199d",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:started",
                      "user_location_id": "5d946b5c5f37c6158337199b",
                      "created_at": "2019-10-02T09:18:20.469",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b5e670dc8057b7b108f",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:user_left_origin",
                      "trip_location_id": "5d946b545f37c6157d371d87",
                      "user_location_id": "5d946b5e670dc8057b7b108d",
                      "created_at": "2019-10-02T09:18:22.782",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b615f37c6157d371d8e",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946b545f37c6157d371d89",
                      "user_location_id": "5d946b605f37c6157d371d8c",
                      "created_at": "2019-10-02T09:18:25.016",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b63670dc805807b0b94",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:user_reached_origin",
                      "trip_location_id": "5d946b545f37c6157d371d88",
                      "user_location_id": "5d946b63670dc805807b0b92",
                      "created_at": "2019-10-02T09:18:27.624",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b63670dc805807b0b95",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:user_left_origin",
                      "trip_location_id": "5d946b545f37c6157d371d89",
                      "user_location_id": "5d946b63670dc805807b0b92",
                      "created_at": "2019-10-02T09:18:27.696",
                      "is_deleted": false
                  },
                  {
                      "id": "5d946b63670dc805807b0b96",
                      "trip_id": "5d946b545f37c6157d371d86",
                      "user_id": "5d946b2f670dc8057b7b108c",
                      "event_type": "trip:completed",
                      "user_location_id": "5d946b63670dc805807b0b92",
                      "created_at": "2019-10-02T09:18:27.782",
                      "is_deleted": false
                  }
              ],
              "user_id": "5d946b2f670dc8057b7b108c",
              "is_started": true,
              "is_ended": true,
              "is_deleted": false,
              "trip_started_at": "2019-10-02T09:18:20.165",
              "trip_ended_at": "2019-10-02T09:18:27.403",
              "distance_covered": 24432.62,
              "duration": 7,
              "is_paused": false,
              "created_at": "2019-10-02T09:18:12.397",
              "updated_at": "2019-10-02T09:18:27.803"
          }
      ]
  }
}

#Get Trip API

This API gives you the trip data of the given trip_id.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

trip_id REQUIRED string 5c40560ea1426005bd908213

https://api.geospark.co/v1/api/trips/

//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": [
      {
          "id": "5d946bc45f37c6157d371d8f",
          "project_id": "5d930b99670dc8057b7b0eb3",
          "origins": [
              {
                  "id": "5d946bc45f37c6157d371d90",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "created_at": "2019-10-02T09:20:04.232",
                  "updated_at": "2019-10-02T09:20:11.730",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.622977,
                          12.917042
                      ]
                  },
                  "reached": true,
                  "left": true,
                  "loc_type": "origin"
              },
              {
                  "id": "5d946bc45f37c6157d371d91",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "created_at": "2019-10-02T09:20:04.245",
                  "updated_at": "2019-10-02T09:20:16.638",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.650239,
                          12.924304
                      ]
                  },
                  "reached": true,
                  "left": true,
                  "loc_type": "origin"
              },
              {
                  "id": "5d946bc45f37c6157d371d92",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "created_at": "2019-10-02T09:20:04.257",
                  "updated_at": "2019-10-02T09:20:16.710",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.743206,
                          12.954302
                      ]
                  },
                  "reached": true,
                  "loc_type": "origin"
              }
          ],
          "destinations": [
              {
                  "id": "5d946bc45f37c6157d371d93",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "created_at": "2019-10-02T09:20:04.269",
                  "updated_at": "2019-10-02T09:20:04.274",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          78.743206,
                          12.954302
                      ]
                  },
                  "reached": false,
                  "loc_type": "destination"
              }
          ],
          "events": [
              {
                  "id": "5d946bc45f37c6157d371d94",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:created",
                  "created_at": "2019-10-02T09:20:04.287",
                  "is_deleted": false
              },
              {
                  "id": "5d946bc6670dc8057b7b1094",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_reached_origin",
                  "trip_location_id": "5d946bc45f37c6157d371d90",
                  "user_location_id": "5d946bc6670dc8057b7b1092",
                  "created_at": "2019-10-02T09:20:06.707",
                  "is_deleted": false
              },
              {
                  "id": "5d946bc95f37c615833719a1",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:started",
                  "user_location_id": "5d946bc95f37c6158337199f",
                  "created_at": "2019-10-02T09:20:09.523",
                  "is_deleted": false
              },
              {
                  "id": "5d946bcb670dc805807b0b99",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_left_origin",
                  "trip_location_id": "5d946bc45f37c6157d371d90",
                  "user_location_id": "5d946bcb670dc805807b0b97",
                  "created_at": "2019-10-02T09:20:11.735",
                  "is_deleted": false
              },
              {
                  "id": "5d946bce5f37c6157d371d97",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_reached_origin",
                  "trip_location_id": "5d946bc45f37c6157d371d91",
                  "user_location_id": "5d946bce5f37c6157d371d95",
                  "created_at": "2019-10-02T09:20:14.099",
                  "is_deleted": false
              },
              {
                  "id": "5d946bd0670dc8057b7b1097",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_left_origin",
                  "trip_location_id": "5d946bc45f37c6157d371d91",
                  "user_location_id": "5d946bd0670dc8057b7b1095",
                  "created_at": "2019-10-02T09:20:16.643",
                  "is_deleted": false
              },
              {
                  "id": "5d946bd0670dc8057b7b1098",
                  "trip_id": "5d946bc45f37c6157d371d8f",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_reached_origin",
                  "trip_location_id": "5d946bc45f37c6157d371d92",
                  "user_location_id": "5d946bd0670dc8057b7b1095",
                  "created_at": "2019-10-02T09:20:16.710",
                  "is_deleted": false
              }
          ],
          "user_id": "5d946b665f37c6158337199e",
          "is_started": true,
          "is_ended": false,
          "is_deleted": false,
          "trip_started_at": "2019-10-02T09:20:09.229",
          "is_paused": false,
          "created_at": "2019-10-02T09:20:04.229",
          "updated_at": "2019-10-02T09:20:16.718"
      }
  ]
}

#Create Trip API

This API helps you to create a new trip with origin, destination and user.

Request

Path Parameters

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id REQUIRED string User id of the device to be assigned this trip.
origins Optional array Origin location in [long, lat] format Eg.[[77.677270, 12.9141325]]
destinations Optional array Destination location in [long, lat] format Eg.[[77.700475, 12.957005]]

https://api.geospark.co/v1/api/trips/

//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 201,
  "data": [
      {
          "id": "5d946da25f37c6157d371d98",
          "origins": [
              {
                  "id": "5d946da25f37c6157d371d99",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.952",
                  "updated_at": "2019-10-02T09:28:02.956",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.622977,
                          12.917042
                      ]
                  },
                  "reached": false,
                  "loc_type": "origin"
              },
              {
                  "id": "5d946da25f37c6157d371d9a",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.964",
                  "updated_at": "2019-10-02T09:28:02.968",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.650239,
                          12.924304
                      ]
                  },
                  "reached": false,
                  "loc_type": "origin"
              }
          ],
          "destinations": [
              {
                  "id": "5d946da25f37c6157d371d9b",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.976",
                  "updated_at": "2019-10-02T09:28:02.981",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          78.743206,
                          12.954302
                      ]
                  },
                  "reached": false,
                  "loc_type": "destination"
              },
              {
                  "id": "5d946da25f37c6157d371d9c",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.988",
                  "updated_at": "2019-10-02T09:28:02.993",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.743206,
                          12.954302
                      ]
                  },
                  "reached": false,
                  "loc_type": "destination"
              }
          ],
          "events": [
              {
                  "id": "5d946da35f37c6157d371d9d",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:created",
                  "created_at": "2019-10-02T09:28:03.006",
                  "is_deleted": false
              }
          ],
          "user_id": "5d946b665f37c6158337199e",
          "is_started": false,
          "is_ended": false,
          "is_deleted": false,
          "is_paused": false,
          "created_at": "2019-10-02T09:28:02.949",
          "updated_at": "2019-10-02T09:28:03.015",
          "trip_tracking_url": "https://trips.gs/NWQ5NDZkYTI1ZjM3YzYxNTdkMzcxZDk4fHNmZHNnZHNh"
      }
  ]
}

#Update Trip API

This API helps you to update the origin, destination or user_id for given trip_id.

Request

Path Parameters

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id REQUIRED string User id of the device to be assigned to this trip.
Eg. 5ccea6ed77aebe1f28fbcc24
origins Optional array Origin location in [long, lat] format. Eg. [[77.677270, 12.9141325]]
destinations Optional array Destination location in [long, lat] format. Eg. [[77.700475, 12.957005]]
trip_id REQUIRED string Trip id which needs to be modified. Eg. 5cd0299d77aebe2d78758d32

https://api.geospark.co/v1/api/trips/

//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 201,
  "data": [
      {
          "id": "5d946da25f37c6157d371d98",
          "origins": [
              {
                  "id": "5d946da25f37c6157d371d99",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.952",
                  "updated_at": "2019-10-02T09:28:02.956",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.622977,
                          12.917042
                      ]
                  },
                  "reached": false,
                  "loc_type": "origin"
              },
              {
                  "id": "5d946da25f37c6157d371d9a",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.964",
                  "updated_at": "2019-10-02T09:28:02.968",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.650239,
                          12.924304
                      ]
                  },
                  "reached": false,
                  "loc_type": "origin"
              }
          ],
          "destinations": [
              {
                  "id": "5d946da25f37c6157d371d9b",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.976",
                  "updated_at": "2019-10-02T09:28:02.981",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          78.743206,
                          12.954302
                      ]
                  },
                  "reached": false,
                  "loc_type": "destination"
              },
              {
                  "id": "5d946da25f37c6157d371d9c",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "created_at": "2019-10-02T09:28:02.988",
                  "updated_at": "2019-10-02T09:28:02.993",
                  "coordinates": {
                      "type": "Point",
                      "coordinates": [
                          77.743206,
                          12.954302
                      ]
                  },
                  "reached": false,
                  "loc_type": "destination"
              }
          ],
          "events": [
              {
                  "id": "5d946da35f37c6157d371d9d",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:created",
                  "created_at": "2019-10-02T09:28:03.006",
                  "is_deleted": false
              },
              {
                  "id": "5d946e615f37c6157d371d9e",
                  "trip_id": "5d946da25f37c6157d371d98",
                  "user_id": "5d946b665f37c6158337199e",
                  "event_type": "trip:user_updated",
                  "created_at": "2019-10-02T09:31:13.698",
                  "is_deleted": false
              }
          ],
          "user_id": "5d946e5b670dc8057b7b1099",
          "is_started": false,
          "is_ended": false,
          "is_deleted": false,
          "is_paused": false,
          "created_at": "2019-10-02T09:28:02.949",
          "updated_at": "2019-10-02T09:31:13.780"
      }
  ]
}

#Geofences

This set of APIs lets you create, get, update, and delete geofences, specific to the project and helps you to keep track of them.

Note: By default, GeoFences are not "event trigger" enabled. To make a geofence "event trigger" enabled, update that particular geofence using Update API and pass the below option.


{"is_enabled": true}
          
          

#Create Geofence API

Create Geofence API is responsible for creating geofences for projects.

Note: All Latitude and Longitude Coordinates mentioned, use EPSG 4236 WGS 84 (Web Mercator Projection) as Coordinate Reference System. GPS from both Android and iOS devices return in the same format. No other CRS is supported.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Body Parameters

coordinates REQUIRED array Mandatory for creating the geofence.
Input Data: Circle [longitude, latitude], OR Polygon[[longitude, latitude], [longitude, latitude],...]
geometry_type REQUIRED string Defines the type of geometry.
Input Data: circle or polygon
geometry_radius REQUIRED integer This field can be used to define a range of time till when the last document needs to be provided. 'end_date' should always be greater than 'start_date'. If end_date is provided then start_date should also be provided. If only start_date is passed, the user list for same day will be returned.
Input Data: 2018-10-20
color_code OPTIONAL string Defines the color of Geofence and how it is displayed in the dashboard. Type : Hex Code for CSS colors. Note :Pass the code without '#'. 2018-10-20 Input Data: ffffff
tag OPTIONAL string Tag the GeoFences for future reference and filtering. Input Data: hotel
description OPTIONAL string Optional description for the geofence. Input Data: This is just a 5 star cool hotel where you can stay.
is_enabled OPTIONAL boolean Enable/Disable 'event_trigger' for Geofences. By default event trigger are disabled. Input Data: true or false

https://api.geospark.co/v1/api/geofence/

//Response
//200:OK

{
  "status": true,
  "msg": "Geofence Added successfully.",
  "code": 201,
  "data": {
      "id": "5bd5bc35eec1a504f3d87382",
      "account_id": "5bbdd7a8eec1a511b246490d",
      "project_id": "5bbdd865eec1a511b246490e",
      "geometry_type": "circle",
      "geometry_radius": 50,
      "geometry_center": {
          "type": "Point",
          "coordinates": [
              -72.28122,
              42.926042
          ]
      },
      "is_enabled": false,
      "color_code": "00BFFF",
      "tag": "Hotel",
      "created_at": "2018-10-28T13:40:05.097",
      "updated_at": "2018-10-28T13:40:05.097"

  }
}

#Update Geofence API

Update details for existing geofence of any specific project using Update Geofence API.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Body Parameters

geofence_id REQUIRED string Identifies the Geofence.
Input Data: 5bd2aee1eec1a50d8faf1293
color_code OPTIONAL string Defines the color of Geofence and how it is displayed in the dashboard. Type : Hex Code for CSS colors. Note :Pass the code without '#'. 2018-10-20 Input Data: ffffff
tag OPTIONAL string This is to tag your geofence for your structural property. Input Data: hotel
description OPTIONAL string Optional description for the geofence. Input Data: This is just a 5 star cool hotel where you can stay.
is_enabled OPTIONAL boolean Enable/Disable 'event_trigger' for Geofences. By default event trigger are disabled. Input Data: true or false

https://api.geospark.co/v1/api/geofence/

//Response
//200:OK

{
  "status": true,
  "msg": "Geofence updated successfully.",
  "code": 200,
  "data": {
      "id": "5bd2aee1eec1a50d8faf1293",
      "geometry": {
          "type": "Polygon",
          "coordinates": [
              [
                  [
                      -72.28122,
                      42.926042
                  ],
                  [
                      -72.2823209,
                      42.9250442
                  ],
                  [
                      -72.2804648,
                      42.9243686
                  ],
                  [
                      -72.2795207,
                      42.9254685
                  ],
                  [
                      -72.2800592,
                      42.9261249
                  ],
                  [
                      -72.28122,
                      42.926042
                  ]
              ]
          ]
      },
      "account_id": "5bbdd7a8eec1a511b246490d",
      "project_id": "5bbdd865eec1a511b246490e",
      "geometry_type": "polygon",
      "geometry_center": {
          "type": "Point",
          "coordinates": [
              -72.28080043090077,
              42.92531143047176
          ]
      },
      "is_enabled": true,
      "description": "Private Resort area",
      "color_code": "ffff",
      "tag": "Hotel",
      "created_at": "2018-10-26T06:06:25.122",
      "updated_at": "2018-10-28T14:00:41.198"
  }
}

#Get Geofence API

This API gives you the filtered list of geofences.

Request

Path Parameters

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

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.
color_code OPTIONAL string Defines the color of Geofence and how it is displayed in the dashboard. Type : Hex Code for CSS colors. Note :Pass the code without '#'. 2018-10-20 Input Data: ffffff
tag OPTIONAL string This is to tag your geofence for your structural property. Input Data: hotel
geometry_type OPTIONAL string Type of the Geofence. Can be either a Circle or Polygon. Input Data: circle or polygon
geofence_id OPTIONAL string To get the data only for a single geofence, pass it's geofence_id. Input Data: 5bd2aee1eec1a50d8faf1293

https://api.geospark.co/v1/api/geofence/

//Response
//200:OK

{
  "status": true,
  "msg": "Success.",
  "code": 200,
  "data": {
      "next_page": null,
      "pages": 1,
      "prev_page": null,
      "account_id": "5bbdd7a8eec1a511b246490d",
      "project_id": "5bbdd865eec1a511b246490e",
      "geofences": [
          {
            "id": "5bc89a4feec1a50e738db301",
            "geometry": {
                "type": "Polygon",
                "coordinates": [
                    [
                        [
                        -0.107524,
                        51.505716
                        ],
                        [
                        -0.100071,
                        51.492607
                        ],
                        [
                        -0.149201,
                        51.490107
                        ],
                        [
                        -0.107524,
                        51.505716
                        ]
                    ]
                ]
          },
          "geometry_type": "polygon",
          "geometry_center": {
              "type": "Point",
              "coordinates": [
                  -0.11893199999993373,
                  51.49614333333265
              ]
          },
          "is_enabled": true,
          "description": "Hotel Area",
          "tag": "Hotel",
          "created_at": "2018-10-18T14:35:59.810",
          "updated_at": "2018-10-18T14:35:59.810"
        },
        {
          "id": "5bc89a75eec1a50e738db302",
          "geometry": {
          "type": "Polygon",
          "coordinates": [
              [
                  [
                  -0.107524,
                  51.505716
                  ],
                  [
                  -0.100071,
                  51.492607
                  ],
                  [
                  -0.149201,
                  51.490107
                  ],
                  [
                  -0.107524,
                  51.505716
                  ]
              ]
          ]
      },
      "geometry_type": "polygon",
      "geometry_center": {
          "type": "Point",
          "coordinates": [
              -0.11893199999993373,
              51.49614333333265
          ]
     },
        "is_enabled": true,
        "tag": "Office",
        "created_at": "2018-10-18T14:36:37.747",
        "updated_at": "2018-10-18T14:36:37.747"
     }
    ]
}
}

#Delete Geofence API

Delete Geofence API allows you to delete already existing geofences for a project.

Request

Path Parameters

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

geofence_id REQUIRED string Deletes the geofence given here.
Input Data: 5bb3177a02a89b3c7a6a8d4f

https://api.geospark.co/v1/api/geofence/

//Response
//200:OK

{
  "status": true,
  "msg": "Geofence deleted successfully.",
  "code": 200,
  "data": {}
}

#Events

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 Events API

This API is responsible for giving the list of events.

Note: All Latitude and Longitude Coordinates mentioned, use EPSG 4236 WGS 84 (Web Mercator Projection) as Coordinate Reference System. GPS from both Android and iOS devices return in the same format. No other CRS is supported.

Request

Headers

Content-Type REQUIRED string application/json
Api-Key REQUIRED string 33223kjhdcscijhb5sdbsdmjsdcbj5f

Query Parameters

user_id OPTIONAL string Filters events data for the given user_id.
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

https://api.geospark.co/v1/api/event/

//Response
//200:OK

{
  "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"
          }
      ]
  }
}