Path parameters
-
The ID of the booking to retrieve.
DELETE
/bookings/{bookingId}
booking
import { TrainTravelSDK } from "train-travel-sdk";
const trainTravelSDK = new TrainTravelSDK({
oAuth2: process.env["TRAINTRAVELSDK_O_AUTH2"] ?? "",
});
async function run() {
const result = await trainTravelSDK.bookings.delete({
bookingId: "1725ff48-ab45-4bb5-9d02-88745177dedb",
});
// Handle the result
console.log(result);
}
run();
curl \
-X DELETE https://try.microcks.io/rest/Train+Travel+API/1.0.0/bookings/1725ff48-ab45-4bb5-9d02-88745177dedb \
-H "Authorization: Bearer $ACCESS_TOKEN"
Response examples (400)
{
"type": "https://example.com/errors/bad-request",
"title": "Bad Request",
"detail": "The request is invalid or missing required parameters.",
"status": 400
}
Response examples (400)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/bad-request</type>
<title>Bad Request</title>
<detail>The request is invalid or missing required parameters.</detail>
<status type="integer">400</status>
</root>
Response examples (401)
{
"type": "https://example.com/errors/unauthorized",
"title": "Unauthorized",
"detail": "You do not have the necessary permissions.",
"status": 401
}
Response examples (401)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/unauthorized</type>
<title>Unauthorized</title>
<detail>You do not have the necessary permissions.</detail>
<status type="integer">401</status>
</root>
Response examples (403)
{
"type": "https://example.com/errors/forbidden",
"title": "Forbidden",
"detail": "Access is forbidden with the provided credentials.",
"status": 403
}
Response examples (403)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/forbidden</type>
<title>Forbidden</title>
<detail>Access is forbidden with the provided credentials.</detail>
<status type="integer">403</status>
</root>
Response examples (404)
{
"type": "https://example.com/errors/not-found",
"title": "Not Found",
"detail": "The requested resource was not found.",
"status": 404
}
Response examples (404)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/not-found</type>
<title>Not Found</title>
<detail>The requested resource was not found.</detail>
<status type="integer">404</status>
</root>
Response examples (429)
{
"type": "https://example.com/errors/too-many-requests",
"title": "Too Many Requests",
"detail": "You have exceeded the rate limit.",
"status": 429
}
Response examples (429)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/too-many-requests</type>
<title>Too Many Requests</title>
<detail>You have exceeded the rate limit.</detail>
<status type="integer">429</status>
</root>
Response examples (500)
{
"type": "https://example.com/errors/internal-server-error",
"title": "Internal Server Error",
"detail": "An unexpected error occurred.",
"status": 500
}
Response examples (500)
<?xml version="1.0" encoding="UTF-8"?>
<root>
<type>https://example.com/errors/internal-server-error</type>
<title>Internal Server Error</title>
<detail>An unexpected error occurred.</detail>
<status type="integer">500</status>
</root>