Skip to main content

Get Trip Data

URL

GET https://api.magicrail.io/trips/list

Description

Retrieve detailed information about all trips.

Authentication

Bearer Token required

Headers

Ensure these headers are included in the request.

  • Content-Type: application/json
  • Authorization: Bearer TOKEN

Success Response

Description of a successful attempt to get all trip data.

  • 🟢 200 OK: Successfully retrieved all trip data

Error Responses

Descriptions of common error responses.

  • 🔴 404 Not Found: No trips found for this user.
  • 🔴 500 Internal Server Error: Internal server error.

Example Call and response

An example showing how to make a request and an example response.

Example Call:

curl -X GET \
-H "Content-Type: application/json" \
-H "Authorization: Bearer TOKEN" \
https://api.magicrail.io/trips/list

Example Response:

[
{
"tripId": "a57355dd-3a9d-4513-b865-2a89ef879201",
"exId": "now-approaching-mk",
"createdAt": "2024-01-15T17:57:48.356Z",
"updatedAt": "2024-01-15T17:57:48.357Z",
"userId": "345873c7-d2f7-417d-a5f0-b921f8da2663"
},
{
"tripId": "5edcb71d-335f-4726-b869-8509d9639084",
"exId": "now-approaching-ak",
"createdAt": "2024-03-04T16:25:59.467Z",
"updatedAt": "2024-03-04T16:25:59.468Z",
"userId": "345873c7-d2f7-417d-a5f0-b921f8da2663"
}
]