Skip to main content

Get Session

GET /v1/traces/:sessionID

Returns the record for a single delivery session for the given sessionID: the session type, per-phase time metrics, events timelines, building polygon, and the driver's activity timeline.

Requires an API key sent as a Bearer token in the Authorization header.

Request

Path Parameters

ParameterTypeRequired?Description
sessionIDstringYesUnique identifier for the session as passed into the Doorstep SDK.
Example: a7fcaea4-9a2c-3001-956d-e08b4560267f

Example Request

curl "https://api.core.doorstep.ai/v1/traces/310454891" \
-H "Authorization: Bearer $API_KEY"

Response

The full analytics record for the requested session.

Response Body

FieldTypeDescription
sessionIDstringUnique identifier for the session as passed into the Doorstep SDK.
Example: a7fcaea4-9a2c-3001-956d-e08b4560267f
addressstringAddress for the given session.
sessionTypestringThe type of delivery. One of: pickup, doorstep, threshold, curbside, or vehicle_handoff.
elevationMethodstring | nullThe method of elevation. Either stairs or elevator, or null if no elevation POI.
metadataobjectExtra information passed to the Doorstep SDK, e.g. driverID, customerID, stopID
eventsarrayTimeline of the session's key events.
events[].typestringThe event type (e.g. parking, dropoff, entrance, elevation).
events[].timestampnumberEpoch seconds when the event occurred.
timeMetricsobjectTime metrics for the given session, in seconds. See Time Metrics for fields walkingTime, inBuildingTime, and idleTime, along with parkingToEntrance and parkingToDropoff described below.
timeMetrics.parkingToEntrancenumber | nullTime from parking to entrance, or null if either POI wasn't recorded.
timeMetrics.parkingToDropoffnumber | nullTime from parking to dropoff, or null if either POI wasn't recorded.
driverActivityarrayTimeline of driver states.
driverActivity[].statestringThe driver's state for the segment.
One of: Driving, Walking, or Idle.
driverActivity[].startTimenumberSegment start, in epoch seconds.
driverActivity[].endTimenumberSegment end, in epoch seconds.
detectedBuildingobjectThe building detected at the session's location.
detectedBuilding.idstringUnique identifier for the detected building.
detectedBuilding.geometryobjectGeoJSON Polygon geometry outlining the building.

Example Response

{
"sessionID": "310454891",
"address": "246 5th Ave, Suite 320, New York, NY 10001",
"sessionType": "doorstep",
"elevationMethod": "elevator",
"metadata": {
"driverID": "d_88213",
"customerID": "c_40921",
"stopID": "2ls846wu68jygh"
},
"events": [
{ "type": "parking", "timestamp": 1783448309 },
{ "type": "entrance", "timestamp": 1783448512 },
{ "type": "elevation", "timestamp": 1783448530 },
{ "type": "dropoff", "timestamp": 1783448549 },
],
"timeMetrics": {
"walkingTime": 285.40,
"inBuildingTime": 285.36,
"idleTime": 308.00,
"parkingToEntrance": 203,
"parkingToDropoff": 240
},
"driverActivity": [
{ "state": "Driving", "startTime": 1783448220, "endTime": 1783448314 },
{ "state": "Walking", "startTime": 1783448314, "endTime": 1783448339 },
{ "state": "Idle", "startTime": 1783448339, "endTime": 1783448367 },
{ "state": "Walking", "startTime": 1783448367, "endTime": 1783448391 },
{ "state": "Idle", "startTime": 1783448391, "endTime": 1783448507 },
{ "state": "Walking", "startTime": 1783448507, "endTime": 1783448921 },
{ "state": "Driving", "startTime": 1783448921, "endTime": 1783449548 }
],
"detectedBuilding": {
"id": "6836551c1692f0hbj",
"geometry": {
"type": "Polygon",
"coordinates": [
[
[-73.988012, 40.748812],
[-73.987965, 40.748812],
[-73.987965, 40.748856],
[-73.988012, 40.748856],
[-73.988012, 40.748812]
]
]
}
}
}