REST API
Last updated
Last updated
Timeseries data can be connected to points within DCH, with the ability to upload and download this data via use of DCH's point data API. Multiple output and input formats are supported, including JSON and CSV. When uploading, a variety of formats are supported, including multiple point data upload and upload of multiple data types. For more information regarding configuring the upload endpoint, see the .
Suppose we know of a point, based on the response of sending a GET request to DCH's /points
endpoint (for more information about finding points, see ):
We can then use either the composite identifier (csiro:managed_datapool:dsapi-big-funny-plant-stream1
) or unique identifier (33b199a8-9eaa-4d75-b4dc-c70aa66a7570
) to upload point data to DCH via REST API. To control the format of the payload uploaded to DCH's POST , the Content-Type
header can be set to either application/json
or text/csv
.
Point data, in the form of timeseries "observations" can be uploaded in JSON format. More detail on this format can be found within the page. The JSON payload consists of two parts:
The metadata header (metadata
): Mapping the point IDs to a brief point alias to reduce the size of point references within the data section of the payload
Using the composite point identifier, of the form <organisation id>:<data pool id>:<point id>
, users can refer to a point using a human-readable identifier, and map this to an alias in the metadata
field of the payload, which is then used to refer to the point within the entries within the data
field of the payload.
Similarly, the unique identifier UUID for the point can be used to refer to the point.
DCH's upload format also allows for the user to upload data for multiple points.
Additionally, using the Content-Type header, CSV data can be uploaded for multiple points
Observations data (data
): A list of observations, containing a timestamp (in ) and point alias, along with the observation data, which can be a numeric scalar (field n
), vector (field v
), or document (field d
).