Locations API

get
Get Locations API

https://api.geospark.co/v3/api/trips/location/
The 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
Response
Request
Headers
Api-key
required
string
Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f
Query Parameters
user_id
required
string
user_id for which the locations has to be returned. E.g.- 5d9450ace47bae6d70064a9b
start_date
required
string
Date from when the locations is to be fetched. E.g.- 2020-09-28
end_date
required
string
Date till when the location is to be returned. E.g.- 2020-09-30
timezone_offset
optional
string
If the timezone is provided the response will be returned as the provided local timezone. If the timezone is not provided, the response will be returned in UTC. If points_encoded value is true, then this value will be UTC by default. E.g.- Asia/Kolkata
page_number
optional
integer
This field is used for getting 10 entries at a time. If the response returns an empty list in the data field, the pages are exhausted. If points_encoded value is true, then this value will not be considered. E.g.- 1
Response
200: OK
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"next_page": null,
"pages": 1,
"prev_page": null,
"app_id": "5f6d94ca4c9a9305b68f78f9_2",
"user_id": "5f71a5085c3a0f0595cebb3d",
"locations": [
{
"speed": 0,
"location_permission": true,
"vertical_accuracy": 10,
"app_context": "M",
"tz_offset": "+0530",
"horizontal_accuracy": 65,
"battery_remaining": 58,
"battery_saver": false,
"battery_status": "unplugged",
"network_status": true,
"course": -1,
"altitude": 880.5610961914062,
"activity": "MOVING",
"tracking_mode": "active",
"coordinates": {
"type": "Point",
"coordinates": [
77.63227212250013,
12.915766127419579
]
},
"created_at": "2020-09-28T09:03:10.181",
"recorded_at": "2020-09-28T09:03:09.946",
"id": "5f71a6cde3872b6a4baca110"
},
{
"speed": 0,
"location_permission": true,
"vertical_accuracy": 10,
"app_context": "M",
"tz_offset": "+0530",
"horizontal_accuracy": 65,
"battery_remaining": 58,
"battery_saver": false,
"battery_status": "unplugged",
"network_status": true,
"course": -1,
"altitude": 880.5610961914062,
"activity": "MOVING",
"tracking_mode": "active",
"coordinates": {
"type": "Point",
"coordinates": [
77.63362982317585,
12.914496143360543
]
},
"created_at": "2020-09-28T09:03:06.926",
"recorded_at": "2020-09-28T09:03:06.626",
"id": "5f71a6cae3872b6a4baca10f"
},
{
"speed": 0,
"location_permission": true,
"vertical_accuracy": 10,
"app_context": "M",
"tz_offset": "+0530",
"horizontal_accuracy": 65,
"battery_remaining": 58,
"battery_saver": false,
"battery_status": "unplugged",
"network_status": true,
"course": -1,
"altitude": 880.5610961914062,
"activity": "MOVING",
"tracking_mode": "active",
"coordinates": {
"type": "Point",
"coordinates": [
77.63362982317585,
12.914496143360543
]
},
"created_at": "2020-09-28T09:03:06.319",
"recorded_at": "2020-09-28T09:03:06.106",
"id": "5f71a6cae3872b6a4baca10e"
},
{
"speed": 0,
"location_permission": true,
"vertical_accuracy": 10,
"app_context": "M",
"tz_offset": "+0530",
"horizontal_accuracy": 65,
"battery_remaining": 58,
"battery_saver": false,
"battery_status": "unplugged",
"network_status": true,
"course": -1,
"altitude": 880.5610961914062,
"activity": "MOVING",
"tracking_mode": "active",
"coordinates": {
"type": "Point",
"coordinates": [
77.63544685214538,
12.914393213589596
]
},
"created_at": "2020-09-28T09:02:46.550",
"recorded_at": "2020-09-28T09:02:45.703",
"id": "5f71a6b5e3872b6a4baca10d"
}
]
}
}

Sample Request

curl --location --request GET 'https://api.geospark.co/v3/api/location/?start_date=2020-09-28T09:02:45&end_date=2020-09-28T09:03:10&user_id=5f71a5085c3a0f0595cebb3d' \
--header 'Api-Key: e704a9543fe54f7799459f8678713754'