CDSS REST Data Submittal

The CDSS REST Data Submittal services provides a way for outside entities to programmatically insert data into HydroBase. Users must authenticate with the service and receive a temporary token to be able to send or request actual data.



Authenticate Authenticates users and supplies them with a token to pass in with requests to other methods in the service
Meter Readings Retrieves, inserts, and updates Meter Reading data

Methods - All

APIDescriptionArea

Authenticate

APIDescription
POST authenticate

Authenticates user using http request header "Authorization: Basic {email}:{password}"

GET authenticate

No documentation available.

MeterReadings

APIDescription
GET api/meterreadings/activeallowedmeters

Retrieve allowed meters for the logged in user

POST api/meterreadings/submit

Inserts or updates Meter Readings (based on Power Service Numbers or Serial Numbers)

Usage Guide

There are 2 main steps in exchanging (both retrieving and sending) data with this service :

  1. Authenticate using the POST authenticate method to retrieve a token
    1. Make a POST request to passing an Authorization header, formatted like
      Authorization: Basic {email}:{password}
    2. If authentication was successful, an HTTP response code 200 will return with body content: "Authorized". The response will have 2 important headers
      1. Token - the token used in each request (as a header) to GET or POST data
      2. TokenExpiry - when the token expires and you will have to re-authenticate (set to 30 minutes after the authentication request)
  2. Make GET or POST request(s) as follows:
    • For all requests (GET or POST), pass in a token header with a valid, non-expired token, formatted like
      Token: {token}
    • For POST requests, you must also provide:
      • A content-type header, describing the format of the data you are sending. This will be formatted like
        Content-Type: application/{contentType}
        where {contentType} will be json or xml, depending on how you format the data, a json header will look like
        Content-Type: application/json
      • A body containing the object or collection of objects (specified by each method) formatted as either xml or json (this format must match the content-type header!)
    The response for all requests will contain a TokenExpiry header. A successful request will renew your Token for 30 minutes after the start of your GET or POST request.

    See the documentation for each method to find out the response types and values for each individual request