Create Trip API v1

The Create Trip API helps you to create a new trip with an origin, destination, and user.

Create Trip API

POST 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": "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": "2021-06-22T06:00:34.261",
            "updated_at": "2021-06-22T06:00:34.261",
            "trip_tracking_url": "https://trips.gs/NWY2OTkzMDI5NzI0MjIwNThmY2ZjYTFlfHNmZHNnZHNh"
        }
    ]
}
curl --location --request POST 'https://api.roam.ai/v1/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]]
}'

Last updated