<back to all web services

ReadingsBulk

The following routes are available for this service:
GET/v8/readings-bulk
GET/v8/readings-bulk/{from}
namespace SDS.V8.APIs.P4.EU.ServiceModel

open System
open System.IO
open System.Collections
open System.Collections.Generic
open System.Runtime.Serialization
open ServiceStack
open ServiceStack.DataAnnotations

    [<AllowNullLiteral>]
    type P4ReadingDay() = 
        member val Ean:String = null with get,set
        member val MeterId:String = null with get,set
        member val QueryDate:DateOnly = new DateOnly() with get,set
        member val MeasureUnit:String = null with get,set
        member val R180:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val R181:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val R182:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val R280:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val R281:Nullable<Decimal> = new Nullable<Decimal>() with get,set
        member val R282:Nullable<Decimal> = new Nullable<Decimal>() with get,set

    [<AllowNullLiteral>]
    type P4ReadingIntervalItem() = 
        member val DateTimeOffset:DateTimeOffset = new DateTimeOffset() with get,set
        member val R180:Decimal = new Decimal() with get,set
        member val R280:Nullable<Decimal> = new Nullable<Decimal>() with get,set

    [<AllowNullLiteral>]
    type P4ReadingInterval() = 
        member val Ean:String = null with get,set
        member val MeterId:String = null with get,set
        member val QueryDate:DateOnly = new DateOnly() with get,set
        member val MeasureUnit:String = null with get,set
        member val Items:ResizeArray<P4ReadingIntervalItem> = null with get,set

    [<AllowNullLiteral>]
    type P4Rejection() = 
        member val Ean:String = null with get,set
        member val QueryDate:DateOnly = new DateOnly() with get,set
        member val QueryReason:String = null with get,set
        member val RejectionCode:String = null with get,set
        member val RejectionText:String = null with get,set

    [<AllowNullLiteral>]
    type P4ReadingsBulk() = 
        member val Message:String = null with get,set
        member val TimeStamp:String = null with get,set
        member val DayObjectCount:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val IntervalObjectCount:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val RejectionObjectCount:Nullable<Int32> = new Nullable<Int32>() with get,set
        member val DayObjects:ResizeArray<P4ReadingDay> = null with get,set
        member val IntervalObjects:ResizeArray<P4ReadingInterval> = null with get,set
        member val RejectionObjects:ResizeArray<P4Rejection> = null with get,set

    [<AllowNullLiteral>]
    type Generic() = 
        ///<summary>
        ///Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY
        ///</summary>
        [<ApiMember(DataType="String", Description="Api-key. Used to provide credentials to the api. Can also be provided through the request headers with key: X-API-KEY", IsRequired=true, Name="ApiKey")>]
        member val ApiKey:String = null with get,set

    type Filter =
        | None = 0
        | Hour = 1
        | Day = 2
        | LastDayOnly = 3
        | Month = 4

    [<AllowNullLiteral>]
    type ReadingsBulk() = 
        inherit Generic()
        interface IGet
        ///<summary>
        ///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!
        ///</summary>
        [<ApiMember(DataType="Time stamp with format: yyyyMMdd-HHmmss-ffffff", 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!", Name="From")>]
        member val From:String = null with get,set

        ///<summary>
        ///Include received interval objects in the result
        ///</summary>
        [<ApiMember(DataType="Boolean, default: true", Description="Include received interval objects in the result", Name="IncludeIntervalObjects")>]
        member val IncludeIntervalObjects:Boolean = new Boolean() with get,set

        ///<summary>
        ///Include received day objects in the result
        ///</summary>
        [<ApiMember(DataType="Boolean, default: false", Description="Include received day objects in the result", Name="IncludeDayObjects")>]
        member val IncludeDayObjects:Boolean = new Boolean() with get,set

        ///<summary>
        ///Gives option to filter return objects, for example to get always only hour records or day records
        ///</summary>
        [<ApiMember(DataType="Enum: None, Hour, Day, LastDayOnly, Month", Description="Gives option to filter return objects, for example to get always only hour records or day records", Name="ObjectFilter")>]
        member val ObjectFilter:Filter = new Filter() with get,set

F# ReadingsBulk DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

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: application/xml
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<P4ReadingsBulk xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/SDS.V8.APIs.P4.EU.ServiceModel.Types">
  <DayObjectCount>0</DayObjectCount>
  <DayObjects xmlns:d2p1="http://schemas.datacontract.org/2004/07/SDS.P4.Common.DTO.EDSN">
    <d2p1:P4ReadingDay>
      <d2p1:Ean>String</d2p1:Ean>
      <d2p1:MeasureUnit>String</d2p1:MeasureUnit>
      <d2p1:MeterId>String</d2p1:MeterId>
      <d2p1:QueryDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" />
      <d2p1:R180>0</d2p1:R180>
      <d2p1:R181>0</d2p1:R181>
      <d2p1:R182>0</d2p1:R182>
      <d2p1:R280>0</d2p1:R280>
      <d2p1:R281>0</d2p1:R281>
      <d2p1:R282>0</d2p1:R282>
    </d2p1:P4ReadingDay>
  </DayObjects>
  <IntervalObjectCount>0</IntervalObjectCount>
  <IntervalObjects xmlns:d2p1="http://schemas.datacontract.org/2004/07/SDS.P4.Common.DTO.EDSN">
    <d2p1:P4ReadingInterval>
      <d2p1:Ean>String</d2p1:Ean>
      <d2p1:Items>
        <d2p1:P4ReadingIntervalItem>
          <d2p1:DateTimeOffset xmlns:d6p1="http://schemas.datacontract.org/2004/07/System">
            <d6p1:DateTime>0001-01-01T00:00:00Z</d6p1:DateTime>
            <d6p1:OffsetMinutes>0</d6p1:OffsetMinutes>
          </d2p1:DateTimeOffset>
          <d2p1:R180>0</d2p1:R180>
          <d2p1:R280>0</d2p1:R280>
        </d2p1:P4ReadingIntervalItem>
      </d2p1:Items>
      <d2p1:MeasureUnit>String</d2p1:MeasureUnit>
      <d2p1:MeterId>String</d2p1:MeterId>
      <d2p1:QueryDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" />
    </d2p1:P4ReadingInterval>
  </IntervalObjects>
  <Message>String</Message>
  <RejectionObjectCount>0</RejectionObjectCount>
  <RejectionObjects xmlns:d2p1="http://schemas.datacontract.org/2004/07/SDS.P4.Common.DTO.EDSN">
    <d2p1:P4Rejection>
      <d2p1:Ean>String</d2p1:Ean>
      <d2p1:QueryDate xmlns:d4p1="http://schemas.datacontract.org/2004/07/System" />
      <d2p1:QueryReason>String</d2p1:QueryReason>
      <d2p1:RejectionCode>String</d2p1:RejectionCode>
      <d2p1:RejectionText>String</d2p1:RejectionText>
    </d2p1:P4Rejection>
  </RejectionObjects>
  <TimeStamp>String</TimeStamp>
</P4ReadingsBulk>