Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Beskrivning

Tjänsten listar mätdata beroende på vilken kategori som anges.

Livscykelstatus

Design

Lösningsbeskrivning

<Infoga en Gliffy-bild som visuellt beskriver lösningen>

Hantering av personuppgifter

<Vilka personuppgifter hanteras och varför?>

API specifikation

Draft:

Swagger ui
---
openapi: 3.0.2
info:
  title: MeasurementData API
  description: "API for fetching measurement-data"
  version: 1.0.0
tags:
  - name: MeasurementData API endpoints
paths:
  /measurmentdata:
    postget:
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GetMeasurementDataRequest'
        required: true      
      responses:
        "200":
          description: Successful operation
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ElectricityData'
                  - $ref: '#/components/schemas/BroadbandData'
                  - $ref: '#/components/schemas/ElectricityData'
                  - $ref: '#/components/schemas/DistrictHeatingData'
                  - $ref: '#/components/schemas/WasteManagementData'
                discriminator:
                  propertyName: objectType
                  mapping:
                    electricityData: '#/components/schemas/ElectricityData'
                    broadbandData: '#/components/schemas/BroadbandData'
                    districtHeatingData: '#/components/schemas/DistrictHeatingData'
                    wasteManagementgData: '#/components/schemas/WasteManagementData'
        "400":
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
        "500":
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceErrorResponse'
components:
  schemas:
      GetMeasurementDataRequest:
        type: object
        properties:
          personId:
            type: string
            description: Person ID
            example: '81471222-5798-11e9-ae24-57fa13b361e1'
          category:
            type: string
            description: Category
            example: 'ELECTRICITY'
          facilityId:
            type: string
            description: Facility ID
            example: '112233'
          fromDate:
            type: string
            format: date
            description: From-date
            example: '2022-01-01'
          toDate:
            type: string
            format: date
            description: To-date
            example: '2022-03-01'
          BroadbandDataresulotion:
          type  $ref: object'#/components/schemas/Resulotion'           description:
Electricity measurments     BroadbandData:
     required:     type: object
      - objectType   description: Electricity measurments
     properties:     required:
       objectType:     - objectType
        type: string   - installationId
          exampleproperties: 'electricityData'
            measurementsobjectType:
              type: arraystring
              descriptionexample: Measurement'electricityData'
              itemsinstallationId:
                type: objecttype: string
              example: '1112233'
            measurements:
          properties    type: array
              description: Measurement
      installationId:        items:
            type: string   type: object
                exampleproperties:
'1112233'
                  unit:
                    type: string
                    example: 'GB'
                  value:
                    type: number
                    format: float
                    example: '22.43'
      ElectricityData:
          type: object
          description: Electricity measurments
          required:
            - objectType
           properties: - installationId
          objectTypeproperties:
            objectType:
 type:              type: string
              example: 'electricityData'
            measurementsinstallationId:
              type: arraystring
              descriptionexample: Measurement'1112233'
              itemsmeasurements:
                type: objectarray
                propertiesdescription: Measurement
                 installationId:
   items:
                type: stringobject
                    exampleproperties:
'1112233'                   fromDatedate:
                    type: string
                    format: date-time
                    example: '2022-01-01 00:00:00'
                  toDatereadingType:
                    type: string
                    formatexample: date-time'Aktiv'
                  value:
 example: '2022-01-02 23:59:00'                 type: number
readingType:                     typeformat: stringfloat
                    example: 'Aktiv6.10000'
                  valueunit:
                    type: numberstring
                    formatexample: float'kWh'
      WasteManagementData:
          type:  object
example: '6.10000'         description: WasteManagement measurments
       unit:   required:
            -  objectType
  type: string         - installationId
          exampleproperties:
'kWh'            objectType:
      degreeDay:        type: string
              typeexample: number'wasteManagementData'
            installationId:
         format: float     type: string
               example: '-3.5241112233'
      WasteManagementData:      measurements:
     type: object        type: array
 description: WasteManagement measurments           requireddescription: Measurement
           -  objectType items:
         properties:       type: object
    objectType:            properties:
  type: string               examplereadingTime:
'wasteManagementData'             measurements:               type: arraystring
              description: Measurement     format: date-time
        items:            example: '2022-01-02 23:59:00'
  type: object               value:
 properties:                   installationIdtype: number
                    typeformat: stringfloat
                    example: '11122336.10000'
                  readingTimeunit:
                    type: string
                    formatexample: date-time'ton'            
         example: '2022-01-02 23:59:00'                   valueproductId:
                    type: number
      string
             format: float                     example: '6.100001063-1380-0-0-0'
                  productIdlocation:
                    type: string
                    example: '1063-1380-0-0-0Blåberget'
                  locationexternalId:
                    type: string
                    example: 'Blåberget1302069'
                  externalIdreference:
                    type: string
                    example: '1302069ABC123'                    
      DistrictHeatingData:
          type: object
          description: DistrictHeating measurments
          required:
            - objectType
            - installationId
          properties:
              objectType:
                type: string
                example: 'districtHeatingData'
              measurementsinstallationId:
                type: arraystring
                descriptionexample: Measurement'1112233'
              measurements:
 items:               type: array
  type: object             description: Measurement
    properties:            items:
        installationId:          type: object
           type: string                       example: '1112233'properties:
                     fromDatedate:
                      type: string
                      format: date-time
                      example: '2022-01-01 00:00:00'
                    toDateenergy:
                      type: stringnumber
                      format: date-timefloat
                      example: '2022-01-02 23:59:004.160000'
                    energyunitEnergy:
                      type: numberstring
                      formatexample: float'MWh'                       example: '4.160000'
                    volume:
                      type: number
                      format: float
                      example: '96.10000'
                    qWunitVolume:
                      type: numberstring
                      format: float
                      example: '23.10000m3'
                    averageQwflowTemprature:
                      type: number
                      format: float
                      example: '2876.100005'
                    effectreturnTemprature:
                      type: numberstring
                      formatexample: float'57.2'                      
example: '0.0180000'     ServiceErrorResponse:
          type: object
   averageEffect:       properties:
            httpCode:
  type: number           format: int32
          format:  float  type: integer
            message:
      example: '0.0240003'       type: string
            subscribedEffecttechnicalDetails:
              $ref: '#/components/schemas/TechnicalDetails'
      typeTechnicalDetails:
string          type: object
           exampleproperties:
'15'            rootCode:
        unit:      format: int32
               type: string
                      example: 'kWh'
                    averegeDegreeDay:
                      type: number
                      format: float
                      example: '-3.524'
                    degreeDays:
                      type: number
                      format: float
                      example: '744.145'
      ServiceErrorResponse:
          type: object
          properties:
            httpCode:
              format: int32
              type: integer
            message:
              type: string
            technicalDetails:
              $ref: '#/components/schemas/TechnicalDetails'integer
            TechnicalDetailsrootCause:
              type: objectstring
            propertiesserviceId:
            rootCode  type: string
             formatrequestId: int32
              type: integerstring
            rootCausedetails:
              type: stringarray
              serviceIditems:
                type: string
      Resulotion:
     requestId:     type: string
        type: string enum:
           details: - Hour
            type:- arrayDay
            -  items:Month
            - Year

 type: string

Säkerhetsklassning

Säkerhetsklass <0, 1, 2, 3, 4>

Autentiseringsmetod: <API Key, Oauth2>

(Ref: Säkerhetsklassning av APIer )

API-ägare

<Kontaktuppgifter till den verksamhet som äger APIets livscykel>

Teknisk ägare

<Kontaktuppgifter till utvecklare/teknisk förvaltare>

Länkar

<Länkar till dev-portal;

  • Test

  • Sandbox

  • Produktion>

FAQ

<FAQ>