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

Request Body

{
    "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