JavaScript
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));
{ "id": "<string>", "name": "<string>", "address": {}, "country": {}, "type": "<string>", "category": {}, "status": "<string>", "supercharger": true, "facility_id": {}, "co2e": {}, "created_at": {}, "updated_at": {} }
Retrieve a single logistic hub by its ID
550e8400-e29b-41d4-a716-446655440000
owned
subcontracted
active
archived
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}"
{ "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" }
x-organization-id
{ "detail": "Logistic hub doesn't belong to organization" }
{ "code": "NOT_FOUND", "detail": "LogisticHUB with id=UUID('...') not found" }