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. Switch API
  2. API Reference

Readings

PreviousMetersNextOverview

Last updated 7 months ago

Was this helpful?

Get registers hourly average readings

get

Required permissions: Meter.Organization.Read

Authorizations
Query parameters
organizationIdinteger · int32Required

The organization identifier

registerIdinteger · int32[]Required

The registers identifiers

startstring · date-timeRequired

The start date and time represented using ISO 8601 format and is always in UTC time, e.g. midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.

endstring · date-timeRequired

The end date and time represented using ISO 8601 format and is always in UTC time, e.g. midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.

Responses
200
The list of registers readings
application/json
400
Input data was invalid
application/json
401
Not authorized
application/json
403
Not allowed
application/json
500
Internal server error
get
GET /api/readings/average/hourly HTTP/1.1
Host: api.switchmarket.se
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "registerId": 1,
    "readings": [
      {
        "timestamp": "2025-06-13T10:19:41.483Z",
        "periodTo": "2025-06-13T10:19:41.483Z",
        "updatedAt": "2025-06-13T10:19:41.483Z",
        "value": 1,
        "resolution": 1
      }
    ]
  }
]
  • GETGet registers readings
  • POSTSave readings
  • GETGet registers hourly average readings

Get registers readings

get

Required permissions: Meter.Organization.Read

Authorizations
Query parameters
organizationIdinteger · int32Required

The organization identifier

registerIdinteger · int32[]Required

The registers identifiers

startstring · date-timeRequired

The start date and time represented using ISO 8601 format and is always in UTC time, e.g. midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.

endstring · date-timeRequired

The end date and time represented using ISO 8601 format and is always in UTC time, e.g. midnight UTC on Jan 1, 2014 would look like this: '2014-01-01T00:00:00Z'.

resolutioninteger · int32Optional

The readings resolution in seconds and if not supplied the default value is 0 seconds

Responses
200
The list of registers readings
application/json
400
Input data was invalid
application/json
401
Not authorized
application/json
403
Not allowed
application/json
500
Internal server error
get
GET /api/readings HTTP/1.1
Host: api.switchmarket.se
Authorization: Bearer YOUR_OAUTH2_TOKEN
Accept: */*
[
  {
    "registerId": 1,
    "readings": [
      {
        "timestamp": "2025-06-13T10:19:41.483Z",
        "periodTo": "2025-06-13T10:19:41.483Z",
        "updatedAt": "2025-06-13T10:19:41.483Z",
        "value": 1,
        "resolution": 1
      }
    ]
  }
]

Save readings

post

Required permission is Meter.Organization.ReadWrite in the organization(s) that have access to the meters.

Authorizations
Body
all ofOptional
Responses
204
The readings were saved
400
Input data was invalid
application/json
401
Not authorized
application/json
403
Not allowed
application/json
500
Internal server error
post
POST /api/readings HTTP/1.1
Host: api.switchmarket.se
Authorization: Bearer YOUR_OAUTH2_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 131

{
  "meters": [
    {
      "id": "text",
      "registers": [
        {
          "id": "text",
          "values": [
            {
              "timestamp": "2025-06-13T10:19:41.483Z",
              "value": 1,
              "resolution": 1
            }
          ]
        }
      ]
    }
  ]
}

No content