Get Trip API

Get trip_list API helps to get list of trips based on various parameters.

get
Get Trips API

https://api.roam.ai/v1/api/trips/
Request
Response
Request
Headers
Api-key
required
string
Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f
Query Parameters
user_id
optional
string
Used to get the list of trips assigned to the given user_id. E.g.- 5d9450ace47bae6d70064a9b
start_date
required
string
Date from when trips need to be returned. E.g.- 2020-08-15
end_date
required
string
Date till when the trip list needs to be returned. E.g.- 2020-08-20
trip_id
optional
string
Used to get one particular trip. E.g.- 5f7d9926e5fc233610297c76
page_number
optional
integer
Used to traverse through pages of data. E.g.- 1
Response
200: OK
{
"status": true,
"msg": "Success.",
"code": 200,
"data": [
{
"id": "5f7d9926e5fc233610297c76",
"project_id": "5f7d656ae5fc233611297c6c",
"origins": [
{
"id": "5f7d9926e5fc233610297c77",
"trip_id": "5f7d9926e5fc233610297c76",
"created_at": "2021-06-07T10:32:06.527",
"updated_at": "2021-06-07T10:32:06.538",
"coordinates": {
"type": "Point",
"coordinates": [
77.622977,
12.917042
]
},
"loc_type": "origin"
},
{
"id": "5f7d9926e5fc233610297c78",
"trip_id": "5f7d9926e5fc233610297c76",
"created_at": "2021-06-07T10:32:06.545",
"updated_at": "2021-06-07T10:32:06.552",
"coordinates": {
"type": "Point",
"coordinates": [
77.650239,
12.924304
]
},
"loc_type": "origin"
},
{
"id": "5f7d9926e5fc233610297c79",
"trip_id": "5f7d9926e5fc233610297c76",
"created_at": "2021-06-07T10:32:06.560",
"updated_at": "2021-06-07T10:32:06.571",
"coordinates": {
"type": "Point",
"coordinates": [
77.743206,
12.954302
]
},
"loc_type": "origin"
}
],
"destinations": [
{
"id": "5f7d9926e5fc233610297c7a",
"trip_id": "5f7d9926e5fc233610297c76",
"created_at": "2021-06-07T10:32:06.578",
"updated_at": "2021-06-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": "2021-06-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": "2021-06-07T10:32:06.522",
"updated_at": "2021-06-07T10:32:06.603"
}
]
}

Sample Request

curl --location --request GET 'https://api.roam.ai/v1/api/trips/?user_id=5f7d95f1ffb3fb58435309de' \
--header 'Api-key: 4db3d709296a4a518a03bf15f37c55b7' \
--header 'Content-Type: application/json'