An API to retrieve real-time data from Curb devices or locations
Live data staging
A channel for real-time samples
Receive real-time samples for a given location
Available only on servers:
Accepts one of the following messages:
This is the payload when the subscription type is "location". The data that are returned are determined by the segment_requests that were sent as part of the subscription payload. So with the following subscription:
{
"type": "location",
"id": "<location_uuid>",
"segment_requests": {
"consumption": ["p", "i"],
"phase0": ["v"],
"SomeCategoryId": ["*"]
}
}
The keys of this object are the query segment id, and the value is an array of measures. The wildcard ["*"] can be used to request all available measures for the query segment.
The client can expect the following live data response:
{
"time": "2023-04-21T04:20:56.000Z",
"data": {
"consumption": { "p": 839.118, "i": 6.99266 },
"phase0": { "v": 120 },
"SomeCategoryId": { "i": 0.590828, "p": 70.8994, "s": 70.8994, "q": 70.8994, "pf": 1 }
}
}
{
"time": "2023-04-21T04:20:56.000Z",
"data": {
"consumption": {
"p": 839.118,
"i": 6.99266
},
"phase0": {
"v": 120
},
"SomeCategoryId": {
"i": 0.590828,
"p": 70.8994,
"s": 70.8994,
"q": 70.8994,
"pf": 1
}
}
}
{
"t": 0,
"h": "string",
"c": 0,
"p": 0,
"v0": 0,
"v1": 0,
"f0": 0,
"f1": 0,
"i0": 0,
"i1": 0,
"i2": 0,
"i3": 0,
"i4": 0,
"i5": 0,
"i6": 0,
"i7": 0,
"i8": 0,
"i9": 0,
"p0": 0,
"p1": 0,
"p2": 0,
"p3": 0,
"p4": 0,
"p5": 0,
"p6": 0,
"p7": 0,
"p8": 0,
"p9": 0,
"pf0": 0,
"pf1": 0,
"s0": 0,
"s1": 0,
"s2": 0,
"s3": 0,
"s4": 0,
"s5": 0,
"s6": 0,
"s7": 0,
"s8": 0,
"s9": 0
}
A channel for real-time samples
Send a payload that describes a subscription to a location or device. To authenticate, client should use an Authorization header with a bearer token in the initial connection request. Clients that are unable to send custom request headers (eg. web browsers) can send a separate authorization message.
Available only on servers:
Accepts one of the following messages:
The client sends this message to subscribe to a location or device. The payload must include a type (either "location" or "device"), and an id for the given type.
If subscribing to a location, the client must also include segment_requests. The schema for this is the same as the schema for the request body for the historical time series request, which is documented here https://hds.dev.cody-sandbox.elevationcurb.com/docs/v1/#/operations/getTimeseriesForLocation#request-body
{
"type": "subscription",
"payload": {
"type": "device",
"id": "<device_id>"
}
}
{
"type": "subscription",
"payload": {
"type": "location",
"id": "<some_location_id>",
"segment_requests": {
"consumption": [
"p"
],
"phase0": [
"v",
"f"
],
"SomeCategory": [
"*"
]
}
}
}
{
"Authorization": "string"
}
Only use this if you are unable to send request headers with the original connection request (eg. browser clients). Otherwise, just use the Authorization request header, which is described below.
{
"type": "authorize",
"payload": {
"access_token": "string"
}
}
{
"Authorization": "string"
}
Only use this if you are unable to send request headers with the original connection request (eg. browser clients). Otherwise, just use the Authorization request header, which is described below.
The client sends this message to subscribe to a location or device. The payload must include a type (either "location" or "device"), and an id for the given type.
If subscribing to a location, the client must also include segment_requests. The schema for this is the same as the schema for the request body for the historical time series request, which is documented here https://hds.dev.cody-sandbox.elevationcurb.com/docs/v1/#/operations/getTimeseriesForLocation#request-body
This is the payload when the subscription type is "location". The data that are returned are determined by the segment_requests that were sent as part of the subscription payload. So with the following subscription:
{
"type": "location",
"id": "<location_uuid>",
"segment_requests": {
"consumption": ["p", "i"],
"phase0": ["v"],
"SomeCategoryId": ["*"]
}
}
The keys of this object are the query segment id, and the value is an array of measures. The wildcard ["*"] can be used to request all available measures for the query segment.
The client can expect the following live data response:
{
"time": "2023-04-21T04:20:56.000Z",
"data": {
"consumption": { "p": 839.118, "i": 6.99266 },
"phase0": { "v": 120 },
"SomeCategoryId": { "i": 0.590828, "p": 70.8994, "s": 70.8994, "q": 70.8994, "pf": 1 }
}
}
This is the payload when the subscription type is "device".
Unix seconds-based timestamp
A date ISO string