Update Trip API v1

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

Update Trip API

PUT https://api.roam.ai/v1/api/trips/

Headers

NameTypeDescription

Api-key

string

Auth-key E.g.- 33223kjhdcscijhb5sdbsdmjsdcbj5f

Request Body

NameTypeDescription

user_id

string

user_id to which the trip is to be reassigned E.g.- 5d9450ace47bae6d70064a9q

trip_id

string

Trip id which needs to be modified. E.g.- 5d9450ace47bae6d70064a9b

origins

array

Origin location in [long, lat] format. E.g.- [[77.677270, 12.914131]]

destinations

array

Destination location in [long, lat] format. E.g.- [[77.700475, 12.957005]]

{
    "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]]
}'

Last updated