Get Logistic Hub
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistic-hubs/{hub_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistic-hubs/{hub_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/logistic-hubs/{hub_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"name": "<string>",
"address": {},
"country": {},
"type": "<string>",
"category": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
}Get Logistic Hub
Retrieve a single logistic hub by its ID
GET
/
v1
/
logistic-hubs
/
{hub_id}
Get Logistic Hub
const options = {
method: 'GET',
headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'}
};
fetch('https://api.dcycle.io/v1/logistic-hubs/{hub_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.dcycle.io/v1/logistic-hubs/{hub_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/logistic-hubs/{hub_id} \
--header 'x-api-key: <x-api-key>' \
--header 'x-organization-id: <x-organization-id>'{
"id": "<string>",
"name": "<string>",
"address": {},
"country": {},
"type": "<string>",
"category": {},
"status": "<string>",
"supercharger": true,
"facility_id": {},
"co2e": {},
"created_at": {},
"updated_at": {}
}Get Logistic Hub
Retrieve detailed information about a specific logistic hub in your organization.Request
Path Parameters
uuid
required
The UUID of the logistic hub to retrieveExample:
550e8400-e29b-41d4-a716-446655440000Headers
string
required
Your API key for authenticationExample:
sk_live_1234567890abcdefstring
required
Your organization UUIDExample:
a8315ef3-dd50-43f8-b7ce-d839e68d51faResponse
string
Unique identifier (UUID)
string
Hub name
string | null
Physical address
string | null
ISO country code
string
Hub type:
owned or subcontractedstring | null
Hub category
string
Status:
active or archivedboolean
Whether hub is a supercharger
string | null
Linked facility UUID
number | null
CO2e emissions from linked facility
datetime
Creation timestamp
datetime | null
Last update timestamp
Example
curl -X GET "https://api.dcycle.io/v1/logistic-hubs/550e8400-e29b-41d4-a716-446655440000" \
-H "x-api-key: ${DCYCLE_API_KEY}" \
-H "x-organization-id: ${DCYCLE_ORG_ID}"
import requests
import os
headers = {
"x-api-key": os.getenv("DCYCLE_API_KEY"),
"x-organization-id": os.getenv("DCYCLE_ORG_ID")
}
hub_id = "550e8400-e29b-41d4-a716-446655440000"
response = requests.get(
f"https://api.dcycle.io/v1/logistic-hubs/{hub_id}",
headers=headers
)
hub = response.json()
print(f"{hub['name']}: {hub['co2e'] or 0} kg CO2e")
const axios = require('axios');
const headers = {
'x-api-key': process.env.DCYCLE_API_KEY,
'x-organization-id': process.env.DCYCLE_ORG_ID
};
const hubId = '550e8400-e29b-41d4-a716-446655440000';
axios.get(`https://api.dcycle.io/v1/logistic-hubs/${hubId}`, { headers })
.then(response => console.log(response.data));
Successful Response
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"name": "Madrid Warehouse",
"type": "owned",
"category": "warehouse_ambient",
"address": "Calle Industrial 5, Madrid",
"country": "ES",
"status": "active",
"supercharger": false,
"facility_id": "660e8400-e29b-41d4-a716-446655440000",
"co2e": 1250.5,
"created_at": "2024-11-24T10:30:00Z",
"updated_at": "2024-11-24T10:30:00Z"
}
Common Errors
403 Forbidden
Cause: Logistic hub does not belong to the organization specified inx-organization-id
{
"detail": "Logistic hub doesn't belong to organization"
}
404 Not Found
Cause: Logistic hub with the given ID does not exist{
"code": "NOT_FOUND",
"detail": "LogisticHUB with id=UUID('...') not found"
}
Related Endpoints
List Logistic Hubs
Retrieve all logistic hubs
Update Logistic Hub
Modify logistic hub details
Was this page helpful?