Curb Live Data API 0.1.0

An API to retrieve real-time data from Curb devices or locations

Servers

  • live.staging.energycurb.comwssstaging

    Live data staging

Operations

  • RECEIVE /

    A channel for real-time samples

    Receive real-time samples for a given location

    Operation IDreceive_location_samples

    Available only on servers:

    Accepts one of the following messages:

    • #0Location live data

      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 }
        }
      }
      
      object
        Examples values:
      • {"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}}}

      Examples

    • #1Hub sample

      This is the payload when the subscription type is "device".

      object

      Examples

  • SEND /

    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.

    Operation IDsubscription

    Available only on servers:

    Accepts one of the following messages:

    • #0Subscription

      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

      object
        Examples values:
      • {"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":["*"]}}}
      object

      Examples

    • #1Authorization

      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.

      object
      object

      Examples

Messages

  • #1Authorizationauthorization_payload
    Message IDauthorization_payload

    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.

    object
    object
  • #2Subscriptionsubscription_payload
    Message IDsubscription_payload

    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

    object
      Examples values:
    • {"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":["*"]}}}
    object
  • #3Location live datalocation_live_data
    Message IDlocation_live_data

    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 }
      }
    }
    
    object
      Examples values:
    • {"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}}}
  • #4Hub samplehub_sample
    Message IDhub_sample

    This is the payload when the subscription type is "device".

    object

Schemas

  • timestamp
    integer
    format: unix-timestamp

    Unix seconds-based timestamp

  • datestring
    string
    format: date-isostring

    A date ISO string

  • object
  • object
      Examples values:
    • {"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":["*"]}}}
  • object
      Examples values:
    • {"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}}}
  • object