Get Latest Neighbor Comparison
get
/apis/neighborComparison-v1/{utilityCode}/customers/{id}/neighbor_comparison
Provides the latest neighbor comparison for a customer as of a particular date. Note that the date ranges for gas and electric are usually different. These ranges come from the billing cycle of the customer and it is uncommon for customers to receive both gas and electric bills on the same cycle. For the combined fuel-type, we pro-rate and normalize the gas reads (including those outside the gas bill returned in the "gas" section) to the electric billing cycle. A comparison is not guaranteed for all fuel types. For example, a customer's gas account may have usage gaps that prohibit the generation of a neighbor comparison.
Request
Path Parameters
-
id(required): number
The unique identifier of the Customer for which to retrieve a neighbor comparison
-
utilityCode(required): string
A 3- or 4-character representation of the client code, in all caps. Valid example - UTIL.
Query Parameters
-
asOf: string
Date in `YYYY-MM-DD` format (example 2001-12-31). The default value of the parameter is 'now'
Header Parameters
-
Authorization(required): string
Oauth2 Bearer type id. For example, 'Bearer 00000000-0000-0000-0000-000000000000'
Response
Supported Media Types
- application/json
200 Response
Successful response. A 200 response is returned if at least one fuel type generates a neighbor comparison. For dual-fuel customers, both fuel types and a combined comparison are not guaranteed if billing periods are not aligned or there are gaps in the billing data.
Root Schema : schema
Type:
Show Source
object
-
response(required):
object NeighborComparisonResponse
Container for the neighbor comparisons based on a particular fuel type. If a particular fuel is not defined there will be no key for it
Example:
{
"response":{
"ELEC":{
"you":123.45,
"neighbors":456.78,
"efficientNeighbors":100.1,
"startDate":"2018-01-02",
"endDate":"2018-02-31",
"numNeighbors":98,
"numEfficientNeighbors":20
},
"GAS":{
"you":12.45,
"neighbors":45.78,
"efficientNeighbors":10.1,
"startDate":"2018-01-03",
"endDate":"2018-02-02",
"numNeighbors":94,
"numEfficientNeighbors":20
},
"COMBINED":{
"you":12.45,
"neighbors":45.78,
"efficientNeighbors":10.1,
"startDate":"2018-01-03",
"endDate":"2018-02-01",
"numNeighbors":96,
"numEfficientNeighbors":20
}
}
}
Nested Schema : NeighborComparisonResponse
Type:
object
Container for the neighbor comparisons based on a particular fuel type. If a particular fuel is not defined there will be no key for it
Show Source
Nested Schema : SingleFuelTypeComparison
Type:
Show Source
object
-
efficientNeighbors(required):
number
The customer's average usage over the time period for efficient neighbors only.
-
endDate(required):
string(date-time)
End date of the period of comparison (inclusive), defined as a string in `YYYY-MM-DD` format.
-
neighbors(required):
number
The customer's average usage over the time period for all neighbors.
-
numEfficientNeighbors(required):
integer
Minimum Value:
0
The number of neighbors considered "efficient" that are used in the comparison. -
numNeighbors(required):
integer
Minimum Value:
0
The number of neighbors used in the comparison. -
startDate(required):
string(date-time)
Start date of the period of comparison, defined as a string in `YYYY-MM-DD` format.
-
you(required):
number
The customer's average usage over the time period.
400 Response
Bad request
Root Schema : schema
Type:
Show Source
object
Example:
{
"error":{
"httpStatus":400,
"errorMessage":"For input string: '{inputString}'"
}
}
Nested Schema : ErrorResponse
Type:
Show Source
object
-
details:
string
Details about the error.
-
errorMessage:
string
Short failure explanation.
-
httpStatus:
integer
Minimum Value:
100
Maximum Value:600
The HTTP status code for the error. -
serviceErrorCode:
string
An error code for the error.
401 Response
Authorization failure
Root Schema : schema
Type:
Show Source
object
Example:
{
"error":{
"httpStatus":401,
"errorMessage":"Unauthorized"
}
}
Nested Schema : ErrorResponse
Type:
Show Source
object
-
details:
string
Details about the error.
-
errorMessage:
string
Short failure explanation.
-
httpStatus:
integer
Minimum Value:
100
Maximum Value:600
The HTTP status code for the error. -
serviceErrorCode:
string
An error code for the error.
403 Response
Forbidden
Root Schema : schema
Type:
Show Source
object
Example:
{
"error":{
"httpStatus":403,
"details":"User not authorized. Missing required scope utility.{utilityCode}.{tier}"
}
}
Nested Schema : ErrorResponse
Type:
Show Source
object
-
details:
string
Details about the error.
-
errorMessage:
string
Short failure explanation.
-
httpStatus:
integer
Minimum Value:
100
Maximum Value:600
The HTTP status code for the error. -
serviceErrorCode:
string
An error code for the error.
404 Response
Customer not found
Root Schema : schema
Type:
Show Source
object
Example:
{
"error":{
"httpStatus":404,
"errorMessage":"'No customer with id {customerId}' or 'HTTP 404 Not Found'"
}
}
Nested Schema : ErrorResponse
Type:
Show Source
object
-
details:
string
Details about the error.
-
errorMessage:
string
Short failure explanation.
-
httpStatus:
integer
Minimum Value:
100
Maximum Value:600
The HTTP status code for the error. -
serviceErrorCode:
string
An error code for the error.
500 Response
Internal error
Root Schema : schema
Type:
Show Source
object
Example:
{
"error":{
"httpStatus":500,
"serviceErrorCode":"UNKNOWN",
"details":"For input string: '{inputString}'"
}
}
Nested Schema : ErrorResponse
Type:
Show Source
object
-
details:
string
Details about the error.
-
errorMessage:
string
Short failure explanation.
-
httpStatus:
integer
Minimum Value:
100
Maximum Value:600
The HTTP status code for the error. -
serviceErrorCode:
string
An error code for the error.