{"status": true,"msg": "Success.","code": 201,"data": [{"id": "<ID>","origins": [{"id": "<ID>","trip_id": "<TRIP-ID>","created_at": "2020-09-22T06:00:34.264","updated_at": "2020-09-22T06:00:34.269","coordinates": {"type": "Point","coordinates": [77.622977,12.917042]},"loc_type": "origin"}],"destinations": [{"id": "<ID>","trip_id": "<TRIP-ID>","created_at": "2020-09-22T06:00:34.272","updated_at": "2020-09-22T06:00:34.275","coordinates": {"type": "Point","coordinates": [77.650239,12.924304]},"loc_type": "destination"},{"id": "<ID>","trip_id": "<TRIP-ID>","created_at": "2020-09-22T06:00:34.278","updated_at": "2020-09-22T06:00:34.281","coordinates": {"type": "Point","coordinates": [77.697418,12.959172]},"loc_type": "destination"}],"events": [],"user_id": "<USER-ID>","is_started": false,"is_ended": false,"is_deleted": false,"created_at": "2020-09-22T06:00:34.261","updated_at": "2020-09-22T06:00:34.261","trip_tracking_url": "https://trips.gs/NWY2OTkzMDI5NzI0MjIwNThmY2ZjYTFlfHNmZHNnZHNh"}]}
curl --location --request POST 'https://api.geospark.co/v3/api/trips/' \--header 'Api-key: <API-KEY>' \--header 'Content-Type: application/json' \--data-raw '{"user_id": "<USER-ID>","origins": [[77.622977 ,12.917042]],"destinations":[[77.650239 ,12.924304], [77.697418 ,12.959172]]}'
{"status": true,"msg": "Success.","code": 200,"data": [{"id": "5f7d9926e5fc233610297c76","project_id": "5f7d656ae5fc233611297c6c","origins": [{"id": "5f7d9926e5fc233610297c77","trip_id": "5f7d9926e5fc233610297c76","created_at": "2020-10-07T10:32:06.527","updated_at": "2020-10-07T10:32:06.538","coordinates": {"type": "Point","coordinates": [77.622977,12.917042]},"loc_type": "origin"},{"id": "5f7d9926e5fc233610297c78","trip_id": "5f7d9926e5fc233610297c76","created_at": "2020-10-07T10:32:06.545","updated_at": "2020-10-07T10:32:06.552","coordinates": {"type": "Point","coordinates": [77.650239,12.924304]},"loc_type": "origin"},{"id": "5f7d9926e5fc233610297c79","trip_id": "5f7d9926e5fc233610297c76","created_at": "2020-10-07T10:32:06.560","updated_at": "2020-10-07T10:32:06.571","coordinates": {"type": "Point","coordinates": [77.743206,12.954302]},"loc_type": "origin"}],"destinations": [{"id": "5f7d9926e5fc233610297c7a","trip_id": "5f7d9926e5fc233610297c76","created_at": "2020-10-07T10:32:06.578","updated_at": "2020-10-07T10:32:06.584","coordinates": {"type": "Point","coordinates": [78.743206,12.954302]},"loc_type": "destination"}],"events": [{"id": "5f7d99298fd7a058fbff9ff9","trip_id": "5f7d9926e5fc233610297c76","user_id": "5f7d95f1ffb3fb58435309de","event_type": "geospark:trip:created","created_at": "2020-10-07T10:32:09.699","is_deleted": false,"event_source": "geospark:trip","event_version": "1.0"}],"user_id": "5f7d95f1ffb3fb58435309de","is_started": false,"is_ended": false,"is_deleted": false,"created_at": "2020-10-07T10:32:06.522","updated_at": "2020-10-07T10:32:06.603"}]}
curl --location --request GET 'https://api.geospark.co/v3/api/trips/?user_id=5f7d95f1ffb3fb58435309de' \--header 'Api-key: 4db3d709296a4a518a03bf15f37c55b7' \--header 'Content-Type: application/json'
user_id
for a given trip_id
before starting the trip.{"status": true,"msg": "Success.","code": 201,"data": [{"id": "<ID>","origins": [{"id": "<ID>","trip_id": "<TRIP-ID>","created_at": "2020-09-22T06:00:34.264","updated_at": "2020-09-22T06:00:34.269","coordinates": {"type": "Point","coordinates": [77.622977,12.917042]},"loc_type": "origin"}],"destinations": [{"id": "<ID>","trip_id": "<TRIP-ID>","created_at": "2020-09-22T06:01:44.680","updated_at": "2020-09-22T06:01:44.687","coordinates": {"type": "Point","coordinates": [77.700475,12.957005]},"loc_type": "destination"}],"events": [{"id": "<ID>","trip_id": "<TRIP-ID>","user_id": "<USER-ID>","event_type": "motion:trip:created","created_at": "2020-09-22T06:00:35.210","is_deleted": false,"event_source": "motion:trip","event_version": "1.0"},{"id": "<ID>","trip_id": "<TRIP-ID>","user_id": "<USER-ID>","event_type": "motion:trip:created","created_at": "2020-09-22T06:01:42.606","is_deleted": false,"event_source": "motion:trip","event_version": "1.0"}],"user_id": "<USER-ID>","is_started": false,"is_ended": false,"is_deleted": false,"created_at": "2020-09-22T06:00:34.261","updated_at": "2020-09-22T06:01:44.699"}]}
curl --location --request PUT 'https://api.geospark.co/v3/api/trips/' \--header 'Api-key: <API-KEY>' \--header 'Content-Type: application/json' \--data-raw '{"trip_id": "<TRIP-ID>","destinations": [[77.700475, 12.957005]]}'
{"status": true,"msg": "Trip deleted successfully.","code": 200,"data": null}
curl --location --request DELETE 'https://api.geospark.co/v3/api/trips/?trip_id=<TRIP-ID>' \--header 'Content-Type: application/json' \--header 'Api-key: <API-KEY>'
trip_id
with its route, distance and duration.
Note: distance_covered is in meters and duration is in seconds.{"status": true,"msg": "Success.","code": 200,"data": {"trip_id": "<TRIP-ID>","user_id": "<USER-ID>","project_id": "<PROJECT-ID>","trip_status": "completed","distance_covered": 2938.974,"duration": 336,"route_indexes": [[1,43],[44]],"route": [{"coordinates": {"type": "Point","coordinates": [77.7012468,12.9727756]},"altitude": 803.7,"activity": "STOP","recorded_at": "2020-08-25T06:01:51.875"},{"coordinates": {"type": "Point","coordinates": [77.70124362,12.97277827]},"altitude": 796.26,"activity": "MOVING","recorded_at": "2020-08-25T06:01:54.547"},{"coordinates": {"type": "Point","coordinates": [77.70124358,12.97277814]},"altitude": 796.8,"activity": "MOVING","recorded_at": "2020-08-25T06:01:55.668"},............{"coordinates": {"type": "Point","coordinates": [77.7007289,12.9736034]},"altitude": 807.3,"activity": "STOP","recorded_at": "2020-08-25T06:28:57.152"}]}}
curl --location --request GET 'https://api.geospark.co/v3/api/trips/summary/?trip_id=5f44a2fce289b825457e5497' \--header 'Api-key: <API-KEY>'
{"status": true,"msg": "Success.","code": 200,"data": {"download_url": "https://geospark-gpx-files.s3.amazonaws.com/5fdc5470203bda0000abacc0.gpx"}}
curl --location --request GET 'https://api.geospark.co/v3/api/trips/export/?trip_id=5fdc5470203bda0000abacc0&type=gpx' \--header 'api-key: 083591a3392c483e838f66ac788126eb'