| GET | /v8/readings-bulk | ||
|---|---|---|---|
| GET | /v8/readings-bulk/{from} |
"use strict";
export class Generic {
/** @param {{apiKey?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/**
* @type {string}
* @description Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY */
apiKey;
}
export class P4ReadingDay {
/** @param {{ean?:string,meterId?:string,queryDate?:string,measureUnit?:string,r180?:number,r181?:number,r182?:number,r280?:number,r281?:number,r282?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
ean;
/** @type {string} */
meterId;
/** @type {string} */
queryDate;
/** @type {string} */
measureUnit;
/** @type {?number} */
r180;
/** @type {?number} */
r181;
/** @type {?number} */
r182;
/** @type {?number} */
r280;
/** @type {?number} */
r281;
/** @type {?number} */
r282;
}
export class P4ReadingIntervalItem {
/** @param {{dateTimeOffset?:string,r180?:number,r280?:number}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
dateTimeOffset;
/** @type {number} */
r180;
/** @type {?number} */
r280;
}
export class P4ReadingInterval {
/** @param {{ean?:string,meterId?:string,queryDate?:string,measureUnit?:string,items?:P4ReadingIntervalItem[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
ean;
/** @type {string} */
meterId;
/** @type {string} */
queryDate;
/** @type {string} */
measureUnit;
/** @type {P4ReadingIntervalItem[]} */
items;
}
export class P4Rejection {
/** @param {{ean?:string,queryDate?:string,queryReason?:string,rejectionCode?:string,rejectionText?:string}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {string} */
ean;
/** @type {string} */
queryDate;
/** @type {string} */
queryReason;
/** @type {string} */
rejectionCode;
/** @type {string} */
rejectionText;
}
export class P4ReadingsBulk {
/** @param {{message?:string,timeStamp?:string,dayObjectCount?:number,intervalObjectCount?:number,rejectionObjectCount?:number,dayObjects?:P4ReadingDay[],intervalObjects?:P4ReadingInterval[],rejectionObjects?:P4Rejection[]}} [init] */
constructor(init) { Object.assign(this, init) }
/** @type {?string} */
message;
/** @type {string} */
timeStamp;
/** @type {?number} */
dayObjectCount;
/** @type {?number} */
intervalObjectCount;
/** @type {?number} */
rejectionObjectCount;
/** @type {?P4ReadingDay[]} */
dayObjects;
/** @type {?P4ReadingInterval[]} */
intervalObjects;
/** @type {?P4Rejection[]} */
rejectionObjects;
}
/** @typedef {'None'|'Hour'|'Day'|'LastDayOnly'|'Month'} */
export var Filter;
(function (Filter) {
Filter["None"] = "None"
Filter["Hour"] = "Hour"
Filter["Day"] = "Day"
Filter["LastDayOnly"] = "LastDayOnly"
Filter["Month"] = "Month"
})(Filter || (Filter = {}));
export class ReadingsBulk extends Generic {
/** @param {{from?:string,includeIntervalObjects?:boolean,includeDayObjects?:boolean,objectFilter?:Filter,apiKey?:string}} [init] */
constructor(init) { super(init); Object.assign(this, init) }
/**
* @type {?string}
* @description If not given, the first object is given after the last request, otherwise gives the first ... data objects received from EDSN/Grid operator received after the given time stamp. Keep in mind, the time stamp is related to when SDS received the data from EDSN, not the date of the data itself! */
from;
/**
* @type {boolean}
* @description Include received interval objects in the result */
includeIntervalObjects;
/**
* @type {boolean}
* @description Include received day objects in the result */
includeDayObjects;
/**
* @type {Filter}
* @description Gives option to filter return objects, for example to get always only hour records or day records */
objectFilter;
}
To override the Content-type in your clients, use the HTTP Accept Header, append the .csv suffix or ?format=csv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
GET /v8/readings-bulk HTTP/1.1 Host: p4.smartdatasolutions.eu Accept: text/csv
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length
{"message":"String","timeStamp":"String","dayObjectCount":0,"intervalObjectCount":0,"rejectionObjectCount":0,"dayObjects":[{"ean":"String","meterId":"String","queryDate":"0001-01-01","measureUnit":"String","r180":0,"r181":0,"r182":0,"r280":0,"r281":0,"r282":0}],"intervalObjects":[{"ean":"String","meterId":"String","queryDate":"0001-01-01","measureUnit":"String","items":[{"dateTimeOffset":"0001-01-01T00:00:00+00:00","r180":0,"r280":0}]}],"rejectionObjects":[{"ean":"String","queryDate":"0001-01-01","queryReason":"String","rejectionCode":"String","rejectionText":"String"}]}