Skip to main content

Get Trip Data

URL

GET https://api.magicrail.io/trip-data/{tripId}

Description

Retrieve trip data for the specified trip ID.

Authentication

Bearer Token required

Headers

Ensure these headers are included in the request.

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

Path Parameters

  • tripId: ID of the trip to retrieve.

Success Response

Description of a successful attempt to get trip data.

  • 🟢 200 OK: Successfully retrieved trip data.

Error Responses

Descriptions of common error responses.

  • 🔴 400 Bad Request: Bad request or authentication error.
  • 🔴 403 Forbidden: Permission denied to access data for the trip.
  • 🔴 404 Not Found: Trip not found or no data available for the specified trip ID.
  • 🔴 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/trip-data/00000000-0000-0000-0000-000000000000

Example Response:

[
{
"id": "1",
"latitude": 40.7128,
"longitude": -74.006,
"elevation": 5,
"time": "2023-01-01T12:00:00Z",
"tripId": "trip123",
"metadata": {
"notes": "Sample notes",
"tags": ["outdoor", "adventure"]
}
},
{
"id": "2",
"latitude": 40.7129,
"longitude": -74.007,
"elevation": 6,
"time": "2023-01-01T12:01:00Z",
"tripId": "trip123",
"metadata": {
"notes": "Another note",
"tags": ["hiking"]
}
},
{
"id": "3",
"latitude": 40.713,
"longitude": -74.008,
"elevation": 7,
"time": "2023-01-01T12:02:00Z",
"tripId": "trip123",
"metadata": {
"notes": null,
"tags": []
}
}
]