Get Business Travel
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/business-travels/{business_travel_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/business-travels/{business_travel_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/business-travels/{business_travel_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"email": {},
"transport_type": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"distance_km": {},
"distance_source": {},
"origin": {},
"destination": {},
"origin_geocode": {
"origin_geocode.country_code": "<string>",
"origin_geocode.place_id": "<string>",
"origin_geocode.address_formatted": "<string>",
"origin_geocode.latitude": 123,
"origin_geocode.longitude": 123
},
"destination_geocode": {},
"travel_type": "<string>",
"travel_number": 123,
"passenger_number": 123,
"vehicle_size": {},
"fuel_type": {},
"renewable_energy": {},
"status": "<string>",
"source": "<string>",
"co2e": {},
"file_id": {},
"file_name": {},
"uploaded_by": {
"uploaded_by.id": "<string>",
"uploaded_by.first_name": {},
"uploaded_by.last_name": {},
"uploaded_by.profile_img_url": {}
},
"created_at": {},
"updated_at": {}
}Get Business Travel
Retrieve a specific business travel record by ID
GET
/
v1
/
business-travels
/
{business_travel_id}
Get Business Travel
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/business-travels/{business_travel_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/business-travels/{business_travel_id}"
headers = {
"x-api-key": "<x-api-key>",
"x-organization-id": "<x-organization-id>"
}
response = requests.get(url, headers=headers)
print(response.text)curl --request GET \
--url https://api.dcycle.io/v1/business-travels/{business_travel_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"email": {},
"transport_type": "<string>",
"start_date": "<string>",
"end_date": "<string>",
"distance_km": {},
"distance_source": {},
"origin": {},
"destination": {},
"origin_geocode": {
"origin_geocode.country_code": "<string>",
"origin_geocode.place_id": "<string>",
"origin_geocode.address_formatted": "<string>",
"origin_geocode.latitude": 123,
"origin_geocode.longitude": 123
},
"destination_geocode": {},
"travel_type": "<string>",
"travel_number": 123,
"passenger_number": 123,
"vehicle_size": {},
"fuel_type": {},
"renewable_energy": {},
"status": "<string>",
"source": "<string>",
"co2e": {},
"file_id": {},
"file_name": {},
"uploaded_by": {
"uploaded_by.id": "<string>",
"uploaded_by.first_name": {},
"uploaded_by.last_name": {},
"uploaded_by.profile_img_url": {}
},
"created_at": {},
"updated_at": {}
}Get Business Travel
Retrieve detailed information about a specific business travel record by its unique identifier.Request
Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faPath Parameters
string
required
The unique identifier (UUID) of the business travel recordExample:
550e8400-e29b-41d4-a716-446655440000Response
string
Unique identifier (UUID)
string
Organization UUID
string | null
Travel record label
string | null
Traveler email
string
Mode of transport:
car, metro, train, trolleybus, bus, motorbike, aircraft, ferrydate
Start date of travel
date
End date of travel
number | null
Distance traveled in kilometers
string | null
How the distance was obtained:
manual (provided directly), geodesic (great-circle for aircraft), or google_maps (other transport types with origin/destination)string | null
Starting location address
string | null
Ending location address
object | null
object | null
Geocoded destination location details (when available). Same structure as
origin_geocode.string
Trip type:
one_way or roundinteger
Number of trips
integer
Number of passengers per trip
string | null
Vehicle size (car only):
small, medium, largestring | null
Fuel type (car only):
diesel, petrol, natural_gas, lpg, electric, hybrid, not_fuel_based, do_not_knowstring | null
Renewable energy usage:
yes, no, do_not_knowstring
Current status:
active, pending, loading, completed, errorstring
Record source:
api, manual, bulk_upload, formnumber | null
Calculated CO2 equivalent emissions in kg.
null or 0 while calculation is pending.string | null
File UUID if created via bulk upload
string | null
File name if created via bulk upload
object | null
datetime
Creation timestamp
datetime | null
Last update timestamp
Example
curl -X GET "https://api.dcycle.io/v1/business-travels/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
travel_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.dcycle.io/v1/business-travels/{travel_id}",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID"),
},
)
travel = response.json()
print(f"Travel: {travel['origin']} -> {travel['destination']}")
print(f"Distance: {travel['distance_km']} km ({travel['distance_source']})")
print(f"Type: {travel['travel_type']}, Status: {travel['status']}")
print(f"Emissions: {travel['co2e']} kg CO2e")
const axios = require('axios');
const travelId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(
`https://api.dcycle.io/v1/business-travels/${travelId}`,
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID,
},
}
)
.then(({ data: travel }) => {
console.log(`Travel: ${travel.origin} -> ${travel.destination}`);
console.log(`Distance: ${travel.distance_km} km (${travel.distance_source})`);
console.log(`Type: ${travel.travel_type}, Status: ${travel.status}`);
console.log(`Emissions: ${travel.co2e} kg CO2e`);
})
.catch(error => console.error(error));
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"name": null,
"email": null,
"transport_type": "train",
"start_date": "2024-12-01",
"end_date": "2024-12-01",
"distance_km": 621.5,
"distance_source": "google_maps",
"origin": "Madrid, Spain",
"destination": "Barcelona, Spain",
"origin_geocode": {
"country_code": "ES",
"place_id": "ChIJgTwKgJcpQg0RaSKMYcHeNsQ",
"address_formatted": "Madrid, Spain",
"latitude": 40.4168,
"longitude": -3.7038
},
"destination_geocode": {
"country_code": "ES",
"place_id": "ChIJ5TCOcRaYpBIRCmZHTz37sEQ",
"address_formatted": "Barcelona, Spain",
"latitude": 41.3874,
"longitude": 2.1686
},
"travel_type": "one_way",
"travel_number": 2,
"passenger_number": 1,
"vehicle_size": null,
"fuel_type": null,
"renewable_energy": null,
"status": "active",
"source": "api",
"co2e": 24.86,
"file_id": null,
"file_name": null,
"uploaded_by": {
"id": "user-123",
"first_name": "Maria",
"last_name": "García",
"profile_img_url": null
},
"created_at": "2024-12-01T10:30:00Z",
"updated_at": "2024-12-01T10:30:00Z"
}
Common Errors
401 Unauthorized
Cause: Missing or invalid API key{"detail": "Invalid API key for organization", "code": "INVALID_API_KEY"}
403 Forbidden
Cause: The authenticated user is not a member of the organization{"detail": "Logged User is not Member of Organization", "code": "LOGGED_USER_NOT_MEMBER"}
404 Not Found
Cause: Business travel not found or doesn’t belong to your organization{"detail": "BusinessTravel with id=550e8400-e29b-41d4-a716-446655440000 not found", "code": "BUSINESS_TRAVEL_NOT_FOUND"}
Related Endpoints
List Business Travels
Retrieve all business travels
Create Business Travel
Create a new business travel record
Update Business Travel
Modify business travel details
Delete Business Travel
Remove a business travel record
Was this page helpful?