Update Trip API

This API allows you to update the origin, destination or user_id for a given trip_id before starting the trip.

put
Update Trip API

https://api.roam.ai/v1/api/trips/
Request
Response
Request
Headers
Api-key
required
string
Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f
Body Parameters
user_id
optional
string
user_id to which the trip is to be reassigned E.g.- 5d9450ace47bae6d70064a9q
trip_id
required
string
Trip id which needs to be modified. E.g.- 5d9450ace47bae6d70064a9b
origins
optional
array
Origin location in [long, lat] format. E.g.- [[77.677270, 12.914131]]
destinations
optional
array
Destination location in [long, lat] format. E.g.- [[77.700475, 12.957005]]
Response
200: OK
{
"status": true,
"msg": "Success.",
"code": 201,
"data": [
{
"id": "<ID>",
"origins": [
{
"id": "<ID>",
"trip_id": "<TRIP-ID>",
"created_at": "2021-06-22T06:00:34.264",
"updated_at": "2021-06-22T06:00:34.269",
"coordinates": {
"type": "Point",
"coordinates": [
77.622977,
12.917042
]
},
"loc_type": "origin"
}
],
"destinations": [
{
"id": "<ID>",
"trip_id": "<TRIP-ID>",
"created_at": "2021-06-22T06:01:44.680",
"updated_at": "2021-06-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": "2021-06-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": "2021-06-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": "2021-06-22T06:00:34.261",
"updated_at": "2021-06-22T06:01:44.699"
}
]
}

Sample Request

curl --location --request PUT 'https://api.roam.ai/v1/api/trips/' \
--header 'Api-key: <API-KEY>' \
--header 'Content-Type: application/json' \
--data-raw '{
"trip_id": "<TRIP-ID>",
"destinations": [[77.700475, 12.957005]]
}'