Skip to main content

Get Trip

URL

GET https://api.magicrail.io/trips/{tripId}

Description

Retrieve detailed information about a trip by providing the trip's unique identifier.

Authentication

Bearer Token required

Headers

Ensure these headers are included in the request.

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

Path Parameters

ID of the trip to retrieve.

  • tripId: ID of the trip to retrieve.

Success Response

Description of a successful retrieval of trip details.

  • 🟢 200 OK: Successfully retrieved trip details.

Error Responses

Descriptions of common error responses.

  • 🔴 400 Bad Request: Bad request or authentication error.
  • 🔴 404 Not Found: Trip not found or permission denied.
  • 🔴 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/00000000-0000-0000-0000-000000000000

Example Response:

{
"trip": {
"id": "123456",
"createdAt": "2024-03-05T20:19:57.103Z",
"updatedAt": "2024-03-05T20:19:57.103Z",
"tripId": "trip123",
"exId": "9y21bdqq",
"userId": "345873c7-d2f7-417d-a5f0-b921f8da2663"
}
}