Users

OW
Last updated 16 days ago

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
Get User API

https://api.geospark.co/v1
/api/user/
Get User API provides the list of users who are using your app corresponding to the project secret API key provided by you.
Request
Response
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
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.
200: OK
JSON
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"next_page": null,
"pages": 1,
"prev_page": null,
"account_id": "5bbdd7a8eec1a511b246490d",
"users": [
{
"id": "5bc982b9eec1a5083d45ae8a",
"app_id": "5bbdd865eec1a511b246490e_1",
"created_at": "2018-10-19T07:07:37.524"
},
{
"id": "5bcd5a90eec1a504184c329a",
"app_id": "5bbdd865eec1a511b246490e_1",
"brand": "Redmi",
"model": "NOTE4",
"os_version": "7.0",
"sdk_version": "2.34",
"created_at": "2018-10-19T05:05:20.640"
},
{
"id": "5bd7e86aeec1a52a6f7e1763",
"app_id": "5bbdd865eec1a511b246490e_1",
"created_at": "2018-10-19T05:13:14.284"
},
{
"id": "5bdad5f7eec1a507afa2fece",
"app_id": "5bbdd865eec1a511b246490e_1",
"device_token": "SDFASDcsdcsdsssssssMcsFASDE",
"description": "John Doe",
"brand": "Iphone",
"model": "6S",
"os_version": "6",
"sdk_version": "1.3.5",
"created_at": "2018-10-19T10:04:19.105"
},
{
"id": "5bf63c38eec1a504c51e7d85",
"app_id": "5bbdd865eec1a511b246490e_1",
"device_token": "SDFASDcsdcsdsssssssscsFASDF",
"description": "Jane Doe",
"brand": "Iphone",
"model": "x",
"os_version": "10",
"sdk_version": "1.3.8",
"created_at": "2018-10-19T03:18:48.284"
}
]
}
}

Sample Call

cURL
JavaScript
Python
Java
Swift
Go
curl -X GET \
'https://api.geospark.co/v1/api/user/?start_date=2019-01-10&end_date=2019-01-12&timezone_offset=Asia/Kolkata' \
-H 'Api-Key: 28c44e3f33de40fbafa0f9dad776b6b2'

get
Get Location API

https://api.geospark.co/v1
/api/location/
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
Headers
Content-Type
required
string
application/json
Api-Key
required
string
33223kjhdcscijhb5sdbsdmjsdcbj5f
Query Parameters
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
user_id
required
string
Filters the location data for the given user_id. Input Data: 5bb3177a02a89b3c7a6a8d4f
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.
200: OK
JSON
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"next_page": 2,
"pages": 17,
"prev_page": null,
"account_id": "5bbdd7a8eec1a511b246490d",
"app_id": "5bbdd865eec1a511b246490e_1",
"user_id": "5bdad5f7eec1a507afa2fece",
"locations": [
{
"id": "5bf69fe8eec1a5110972e407",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"speed": 10.23,
"accuracy": 0.23,
"altitude": 23.33,
"activity": "WALK",
"recorded_at": "2018-10-19T12:04:00.270",
"timezone_offset": "+0100",
"net_stat": true,
"battery_remaining": 99,
"address": "patel nest , bangalore 560100",
"state": "karnataka",
"city": "bangalore",
"street_address": "20th main garden layout",
"country_code": "IN",
"country": "India",
"postal_code": 560100,
"created_at": "2018-10-19T12:24:08.346"
},
{
"id": "5bf69fe8eec1a5110972e409",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
41.86793
]
},
"speed": 10,
"accuracy": 1,
"altitude": 26,
"activity": "DRIVE",
"recorded_at": "2018-10-19T11:42:41.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:24:08.278"
},
{
"id": "5bf69fe8eec1a5110972e40a",
"coordinates": {
"type": "Point",
"coordinates": [
-87.6449,
41.85924
]
},
"speed": 15,
"altitude": 23,
"activity": "DRIVE",
"recorded_at": "2017-10-19T11:42:10.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:24:08.178"
},
{
"id": "5bf69fe8eec1a5110972e40b",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64559,
41.85489
]
},
"speed": 25,
"accuracy": 1,
"altitude": 3,
"activity": "DRIVE",
"recorded_at": "2017-10-19T11:41:15.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:24:08.078"
},
{
"id": "5bf69fe8eec1a5110972e40c",
"coordinates": {
"type": "Point",
"coordinates": [
77.64559,
12.84952
]
},
"speed": 40,
"accuracy": 4,
"altitude": 12,
"activity": "DRIVE",
"recorded_at": "2017-10-19T11:41:05.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:24:07.578"
},
{
"id": "5bf69fe8eec1a5110972e40d",
"coordinates": {
"type": "Point",
"coordinates": [
-87.63357,
41.84415
]
},
"speed": 50,
"accuracy": 2,
"altitude": 10,
"activity": "DRIVE",
"recorded_at": "2017-10-19T11:40:53.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:24:07.379"
},
{
"id": "5bf69fe8eec1a5110972e40f",
"accuracy": 0.23,
"altitude": 23.33,
"activity": "STOP",
"timezone_offset": "+0100",
"started_at": "2018-10-19T11:30:00.271",
"ended_at": "2018-10-19T11:37:38.917",
"net_stat": true,
"app_stat": "BACKGROUND",
"created_at": "2018-10-19T12:24:07.296"
},
{
"id": "5bf7f704eec1a518a227a99f",
"coordinates": {
"type": "Point",
"coordinates": [
-0.11893,
51.49614
]
},
"speed": 10.23,
"accuracy": 0.23,
"altitude": 23.33,
"activity": "WALK",
"recorded_at": "2018-10-19T10:44:00.270",
"timezone_offset": "+0100",
"net_stat": true,
"address": "patel nest , bangalore 560100",
"state": "karnataka",
"city": "bangalore",
"street_address": "20th main garden layout",
"country_code": "IN",
"country": "India",
"postal_code": 560100,
"created_at": "2018-10-19T12:40:04.793"
},
{
"id": "5bf7f71aeec1a518a227a9a1",
"coordinates": {
"type": "Point",
"coordinates": [
-87.64593,
41.86793
]
},
"speed": 10,
"accuracy": 1,
"altitude": 26,
"activity": "DRIVE",
"recorded_at": "2017-10-19T10:42:41.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:40:26.129"
},
{
"id": "5bf7f71aeec1a518a227a9a2",
"coordinates": {
"type": "Point",
"coordinates": [
-87.6449,
41.85924
]
},
"speed": 15,
"altitude": 23,
"activity": "DRIVE",
"recorded_at": "2017-10-19T09:40:51.000",
"timezone_offset": "+0100",
"bat_stat": "Full",
"created_at": "2018-10-19T12:40:26.029"
}
]
}

Sample Call

cURL
JavaScript
Python
Java
Swift
Go
curl -X GET \
'https://api.geospark.co/v1/api/location/?user_id=5bb3177a02a89b3c7a6a8d4f&start_date=2019-01-06&end_date=2019-01-09&page_number=1' \
-H 'Api-Key: eade6d3a72924eb895a19feb44895372'