Switch Developer Documentation
  • Welcome
  • ⚠️Migration to Auth0
    • Overview
    • Status
    • Switch API
      • Client Credentials Flow
      • Organization Client
      • Token Endpoint
    • OpenADR 3 VTN API
      • VTN Credentials
      • Token Endpoint
  • Getting Started
    • Concepts
    • Guides
      • How to send readings
      • Market operations
      • Conditional agreements
    • Support
  • Switch API
    • Overview
    • Terms of Use
    • Authentication
      • Client Credentials Flow
      • Organization Client
      • Token Endpoint
    • Rate Limiting
    • Errors
    • API Reference
      • Market Zones
      • Products
      • Resources
      • Meters
      • Readings
  • OpenADR 3
    • Overview
    • Authentication
      • VTN Credentials
      • Token Endpoint
    • API Reference
      • Programs
      • Events
      • Reports
      • Subscriptions
      • Vens
    • Webhooks
      • Callback URL verification
      • Domain and IP addresses
      • Best practices
    • Payloads
    • Code samples
  • Libraries
    • .NET SDK
      • SDK Reference
        • IAuthService.Auth
        • IProgramsService.Programs
        • IEventsService.Events
        • IReportsService.Reports
        • ISubscriptionsService.Subscriptions
        • IVensService.Vens
Powered by GitBook
On this page

Was this helpful?

  1. OpenADR 3
  2. API Reference

Reports

PreviousEventsNextSubscriptions

Last updated 9 months ago

Was this helpful?

searches reports by reportID

get

Fetch the report specified by the reportID in path.

Authorizations
Path parameters
reportIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
Responses
200
OK.
application/json
400
Bad Request.
application/json
403
Forbidden.
application/json
404
Not Found.
application/json
500
Internal Server Error.
application/json
get
GET /api/openadr/v1/reports/{reportID} HTTP/1.1
Host: vtn3.switchmarket.se
Authorization: Bearer JWT
Accept: */*
{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}

delete a report

delete

Delete the report specified by the reportID in path.

Authorizations
Path parameters
reportIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
Responses
200
OK.
application/json
400
Bad Request.
application/json
403
Forbidden.
application/json
404
Not Found.
application/json
500
Internal Server Error.
application/json
delete
DELETE /api/openadr/v1/reports/{reportID} HTTP/1.1
Host: vtn3.switchmarket.se
Authorization: Bearer JWT
Accept: */*
{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}
  • GETsearches all reports
  • POSTadd a report
  • GETsearches reports by reportID
  • PUTupdate a report
  • DELETEdelete a report

searches all reports

get

List all reports known to the server. May filter results by programID, eventID, and clientName as query param. Use skip and pagination query params to limit response size.

Authorizations
Query parameters
programIDstring · min: 1 · max: 128Optional

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
eventIDstring · min: 1 · max: 128Optional

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
clientNamestringOptional

filter results to reports with clientName.

Example: 999
skipinteger · int32Optional

number of records to skip for pagination.

limitinteger · int32 · max: 50Optional

maximum number of records to return.

x-startstring · date-timeOptional

start of timeperiod for which to return reports (extension - not part of the OpenADR specification)

x-endstring · date-timeOptional

end of timeperiod for which to return reports (extension - not part of the OpenADR specification)

Responses
200
OK.
application/json
400
Bad Request.
application/json
403
Forbidden.
application/json
500
Internal Server Error.
application/json
get
GET /api/openadr/v1/reports HTTP/1.1
Host: vtn3.switchmarket.se
Authorization: Bearer JWT
Accept: */*
[
  {
    "id": "object-999",
    "createdDateTime": "2023-06-15T09:30:00Z",
    "modificationDateTime": "2023-06-15T09:30:00Z",
    "objectType": "REPORT",
    "programID": "object-999",
    "eventID": "object-999",
    "clientName": "VEN-999",
    "reportName": "Battery_usage_04112023",
    "payloadDescriptors": [
      {
        "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
        "payloadType": "USAGE",
        "readingType": "DIRECT_READ",
        "units": "KWH",
        "accuracy": 0,
        "confidence": 100
      }
    ],
    "resources": [
      {
        "resourceName": "RESOURCE-999",
        "intervalPeriod": {
          "start": "2023-06-15T09:30:00Z",
          "duration": "PT1H",
          "randomizeStart": "PT1H"
        },
        "intervals": [
          {
            "id": 0,
            "intervalPeriod": {
              "start": "2023-06-15T09:30:00Z",
              "duration": "PT1H",
              "randomizeStart": "PT1H"
            },
            "payloads": [
              {
                "type": "PRICE",
                "values": [
                  0.17
                ]
              }
            ]
          }
        ]
      }
    ]
  }
]

add a report

post

Create a new report in the server.

Authorizations
Body

report object.

idstring · min: 1 · max: 128Optional

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
createdDateTimestring · date-timeOptional

datetime in ISO 8601 format

Example: 2023-06-15T09:30:00Z
modificationDateTimestring · date-timeOptional

datetime in ISO 8601 format

Example: 2023-06-15T09:30:00Z
objectTypestring · enumOptional

Used as discriminator

Possible values:
programIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
eventIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
clientNamestring · min: 1 · max: 128Required

User generated identifier; may be VEN ID provisioned out-of-band.

Example: VEN-999
reportNamestring | nullableOptional

User defined string for use in debugging or User Interface.

Default: nullExample: Battery_usage_04112023
Responses
201
Created.
application/json
400
Bad Request.
application/json
403
Forbidden.
application/json
409
Conflict. Implementation dependent response if identical report exists.
application/json
500
Internal Server Error.
application/json
post
POST /api/openadr/v1/reports HTTP/1.1
Host: vtn3.switchmarket.se
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 696

{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}
{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}

update a report

put

Update the report specified by the reportID in path.

Authorizations
Path parameters
reportIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
Body

report object.

idstring · min: 1 · max: 128Optional

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
createdDateTimestring · date-timeOptional

datetime in ISO 8601 format

Example: 2023-06-15T09:30:00Z
modificationDateTimestring · date-timeOptional

datetime in ISO 8601 format

Example: 2023-06-15T09:30:00Z
objectTypestring · enumOptional

Used as discriminator

Possible values:
programIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
eventIDstring · min: 1 · max: 128Required

URL safe VTN assigned object ID.

Example: object-999Pattern: ^[a-zA-Z0-9_-]*$
clientNamestring · min: 1 · max: 128Required

User generated identifier; may be VEN ID provisioned out-of-band.

Example: VEN-999
reportNamestring | nullableOptional

User defined string for use in debugging or User Interface.

Default: nullExample: Battery_usage_04112023
Responses
200
OK.
application/json
400
Bad Request.
application/json
403
Forbidden.
application/json
404
Not Found.
application/json
409
Conflict. Implementation dependent response if program with the same programName exists.
application/json
500
Internal Server Error.
application/json
put
PUT /api/openadr/v1/reports/{reportID} HTTP/1.1
Host: vtn3.switchmarket.se
Authorization: Bearer JWT
Content-Type: application/json
Accept: */*
Content-Length: 696

{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}
{
  "id": "object-999",
  "createdDateTime": "2023-06-15T09:30:00Z",
  "modificationDateTime": "2023-06-15T09:30:00Z",
  "objectType": "REPORT",
  "programID": "object-999",
  "eventID": "object-999",
  "clientName": "VEN-999",
  "reportName": "Battery_usage_04112023",
  "payloadDescriptors": [
    {
      "objectType": "REPORT_PAYLOAD_DESCRIPTOR",
      "payloadType": "USAGE",
      "readingType": "DIRECT_READ",
      "units": "KWH",
      "accuracy": 0,
      "confidence": 100
    }
  ],
  "resources": [
    {
      "resourceName": "RESOURCE-999",
      "intervalPeriod": {
        "start": "2023-06-15T09:30:00Z",
        "duration": "PT1H",
        "randomizeStart": "PT1H"
      },
      "intervals": [
        {
          "id": 0,
          "intervalPeriod": {
            "start": "2023-06-15T09:30:00Z",
            "duration": "PT1H",
            "randomizeStart": "PT1H"
          },
          "payloads": [
            {
              "type": "PRICE",
              "values": [
                0.17
              ]
            }
          ]
        }
      ]
    }
  ]
}