Users API

get
Get User API

https://api.geospark.co/v3/api/user/
The Get User API provides the list of users who are using your app corresponding to the project secret API key provided.
Request
Response
Request
Headers
Api-key
required
string
Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f
Query Parameters
user_id
optional
string
Used to get the details of one particular user. Note: This query param cannot be used along with any other.
timezone_offset
optional
string
If the timezone is provided the query will be made as per the given timezone. E.g.- Asia/Kolkata
start_date
required
string
Date from when the data is to be returned. E.g.- 2020-09-10
end_date
required
string
Date till when the data is to be returned. E.g.- 2020-09-13
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, it is safe to assume the pages are exhausted. If points_encoded value is true, 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,
"account_id": "5f7b0150ffb3fb085d7a78ac",
"users": [
{
"id": "5f7c494bffb3fb3cbff6dd59",
"app_id": "5f7c4106e5fc231ce23453fb_2",
"device_token": "devicetoken",
"description": "postman device test",
"brand": "Samsung",
"model": "S8",
"os_version": "8.1",
"sdk_version": "2.1",
"geofence_events": true,
"motion_events": false,
"location_events": false,
"trips_events": true,
"nearby_events": false,
"location_listener": false,
"event_listener": false,
"is_deleted": false,
"created_at": "2020-10-06T16:09:07.690",
"last_location_update": {
"id": "5f7c496c7940651e6ead284c",
"location_id": "5f2ba9edb3611421f252e019",
"coordinates": {
"type": "Point",
"coordinates": [
4.8232481,
52.3413681
]
},
"speed": 0.0,
"altitude": 505.20001220703125,
"activity": "STOP",
"recorded_at": "2020-10-06T10:39:39.036",
"net_stat": true,
"gps_stat": true,
"app_context": "M",
"device_manufacturer": "xiaomi",
"horizontal_accuracy": 20.0,
"vertical_accuracy": 2.199981689453125,
"is_charging": true,
"os_version": "9",
"device_model": "Redmi Note 8",
"location_method": "fused",
"course": 0.0,
"created_at": "2020-10-06T10:39:40.893"
}
},
{
"id": "5f7c4114ffb3fb3cbef6dd43",
"app_id": "5f7c4106e5fc231ce23453fb_2",
"device_token": "devicetoken",
"description": "postman device test",
"brand": "Samsung",
"model": "S8",
"os_version": "8.1",
"sdk_version": "2.1",
"geofence_events": true,
"motion_events": false,
"location_events": false,
"trips_events": true,
"nearby_events": false,
"location_listener": false,
"event_listener": false,
"is_deleted": false,
"created_at": "2020-10-06T15:34:04.331",
"last_location_update": {
"id": "5f7c494e7940651e6ead284b",
"location_id": "5f2ba9edb3611421f252e019",
"coordinates": {
"type": "Point",
"coordinates": [
4.8232481,
52.3413681
]
},
"speed": 0.0,
"altitude": 505.20001220703125,
"activity": "STOP",
"recorded_at": "2020-10-06T10:39:07.607",
"net_stat": true,
"gps_stat": true,
"app_context": "M",
"device_manufacturer": "xiaomi",
"horizontal_accuracy": 20.0,
"vertical_accuracy": 2.199981689453125,
"is_charging": true,
"os_version": "9",
"device_model": "Redmi Note 8",
"location_method": "fused",
"course": 0.0,
"created_at": "2020-10-06T10:39:10.364"
}
}
]
}
}

Sample Request

curl --location --request GET 'https://api.geospark.co/v3/api/user/?start_date=2020-10-06' \
--header 'Api-Key: 761f129e9d3a4de380baa6f4f0e7ab05'

put
Update User API

https://api.geospark.co/v3/api/user/
This API lets you update the details of a user_id.
Request
Response
Request
Headers
Api-key
required
string
Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f
Body Parameters
user_id
required
string
Enable or disable events data for the given user_id. E.g.- 5d9450ace47bae6d70064a9b
description
optional
string
Update user description. E.g.- “test user”
geofence_events
optional
boolean
Enable or disable geofence_events. E.g.- true
trips_events
optional
boolean
Enable or disable trips_events. E.g.- true
location_events
optional
boolean
Enable or disable location_events. E.g.- true
nearby_events
optional
boolean
Enable or disable nearby_events. E.g.- true
event_listener
optional
boolean
Enable or disable event_listener. E.g.- true
location_listener
optional
boolean
Enable or disable location_listener. E.g.- true
Response
200: OK
{
"status": true,
"msg": "Success.",
"code": 200,
"data": {
"id": "5f2bd1e9b3611421f252e36c",
"account_id": "5c0179df6f994031158a5646",
"app_id": "5e95cbe83722794cf72ea0af_1",
"device_token": null,
"device_uuid": null,
"description": "POPOPOPO",
"brand": "Samsung",
"model": "S8",
"group_id": null,
"os_version": "8.1",
"sdk_version": "2.1",
"device_arn": null,
"geofence_events": true,
"motion_events": false,
"location_events": true,
"trips_events": true,
"nearby_events": true,
"location_listener": false,
"event_listener": false,
"metadata": null,
"is_deleted": false,
"created_at": "2020-08-06T09:48:25.662",
"updated_at": "2020-09-29T13:03:49.776"
}
}

Sample Request

curl --location --request PUT 'https://api.geospark.co/v3/api/user/' \
--header 'Content-Type: application/json' \
--header 'APi-Key: eff6e09bd77b43df901d5226f0f1f35b' \
--data-raw '{
"user_id": "5c985d0a9533a353a1ecc2ab",
"description": "POPOPOPO"
}'