Get Hotel Stay
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/hotel-stays/{hotel_stay_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/{hotel_stay_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/hotel-stays/{hotel_stay_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"check_in_date": "<string>",
"check_out_date": "<string>",
"country": "<string>",
"address": {},
"hotel_name": {},
"rooms": 123,
"status": "<string>",
"source": {},
"co2e": {},
"file_id": {},
"file_name": {},
"attachment": {
"file_id": "<string>",
"file_name": "<string>",
"file_url": "<string>"
},
"confidence": {},
"created_at": {},
"updated_at": {},
"custom_ef_record_id": {},
"location_geocode": {
"country_code": "<string>",
"place_id": "<string>",
"address_formatted": "<string>",
"latitude": 123,
"longitude": 123
},
"uploaded_by": {
"id": "<string>",
"first_name": {},
"last_name": {},
"profile_img_url": {}
}
}Get Hotel Stay
Retrieve a specific hotel stay record by ID
GET
/
v1
/
hotel-stays
/
{hotel_stay_id}
Get Hotel Stay
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/hotel-stays/{hotel_stay_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/hotel-stays/{hotel_stay_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/hotel-stays/{hotel_stay_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"organization_id": "<string>",
"name": {},
"check_in_date": "<string>",
"check_out_date": "<string>",
"country": "<string>",
"address": {},
"hotel_name": {},
"rooms": 123,
"status": "<string>",
"source": {},
"co2e": {},
"file_id": {},
"file_name": {},
"attachment": {
"file_id": "<string>",
"file_name": "<string>",
"file_url": "<string>"
},
"confidence": {},
"created_at": {},
"updated_at": {},
"custom_ef_record_id": {},
"location_geocode": {
"country_code": "<string>",
"place_id": "<string>",
"address_formatted": "<string>",
"latitude": 123,
"longitude": 123
},
"uploaded_by": {
"id": "<string>",
"first_name": {},
"last_name": {},
"profile_img_url": {}
}
}← Hotel Stays API
Retrieve detailed information about a specific hotel stay record by its unique identifier.
Request
Headers
Path Parameters
The unique identifier (UUID) of the hotel stay recordExample:
550e8400-e29b-41d4-a716-446655440000Response
The document attached to the stay (
attachment_file_id), or null. Not the file the stay was read from
(file_id). A file deleted or moved to the trash is no longer attached.Show properties
Show properties
The file of your files.
For a stay read from a hotel invoice (
source: "pdf"), the confidence (0 to 1) of that reading per extracted field,
with their average in overall: one score per field of the invoice, or the average of its stays’. null for any
other stay, or when the invoice has no reading.The custom emission factor record the stay is calculated with, or
null for the default factor of its countryExample
curl -X GET "https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
response = requests.get(
"https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000",
headers={
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID")
}
)
stay = response.json()
print(f"{stay['hotel_name']} ({stay['country']}): {stay['co2e']} kg CO2e")
const axios = require('axios');
axios.get(
'https://api.dcycle.io/v1/hotel-stays/550e8400-e29b-41d4-a716-446655440000',
{
headers: {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
}
}
)
.then(r => console.log(r.data))
.catch(error => console.error(error));
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"organization_id": "a8315ef3-dd50-43f8-b7ce-d839e68d51fa",
"name": "Team offsite — Madrid",
"check_in_date": "2024-11-04",
"check_out_date": "2024-11-07",
"country": "ES",
"address": "Calle Gran Vía 28, Madrid",
"hotel_name": "Hotel Gran Vía",
"rooms": 3,
"status": "active",
"source": "manual",
"co2e": 18.54,
"file_id": null,
"file_name": null,
"attachment": null,
"created_at": "2024-11-01T09:00:00Z",
"updated_at": "2024-11-01T09:00:00Z",
"uploaded_by": {
"id": "b9f1e2d3-0000-0000-0000-000000000001",
"first_name": "Ana",
"last_name": "García",
"profile_img_url": null
},
"location_geocode": {
"country_code": "ES",
"place_id": "ChIJgTwKgJcpQg0RaSKMYcHeNsQ",
"address_formatted": "Calle Gran Vía 28, 28013 Madrid, Spain",
"latitude": 40.4203,
"longitude": -3.7059
}
}
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: The hotel stay ID does not exist or belongs to a different organization.{
"detail": "Hotel stay not found",
"code": "HOTEL_STAY_NOT_FOUND"
}
Related Endpoints
List Hotel Stays
Get all hotel stays with filtering
Calculation Steps
Step-by-step CO2e breakdown
Delete Hotel Stay
Remove this record
Was this page helpful?