Versions Compared

Key

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

...

Code Block
languagetext
POST https://api.ddsc.nl/api/v2/locations/ HTTP/1.1

Host: api.ddsc.nl
Accept
username: ddsc_username
password: ddsc_password
Content-Type: application/json,
Accept: textapplication/javascriptjson


{
    "name": "Test28_0",
    "organisation": "Deltaresunique_organisation_id_of_deltares",
    "organisation_code": "deltares_organisation_codeDeltares",
    "geometry": null,
    "access_modifier": 0,
    "ddsc_icon_url": "",
    "ddsc_show_on_map": false,
    "extra_metadata": null
}

 

The location is returned:

Code Block
{
"url": "https://api.ddsc.nl/api/v2/locations/uuid_of_location/"
"uuid": "uuid_of_location"
"name": "28_0"
"organisation": "unique_deltares_organisation_id"
"organisation_code": "Deltares"
"geometry": null
"access_modifier": "Public"
"ddsc_icon_url": ""
"ddsc_show_on_map": false
"extra_metadata": null
"last_modified": "2016-02-19T13:39:00.460952"
"last_modified_by": "deltares_ddsc"
}

A uuid of the location is returned.  uuidlocation

 

Creating a new timeseries for storing events"

Code Block
POST https://api.ddsc.nl/api/v2/timeseries/
{
    "name": "Locatie128_0",
    "description": "28_0",
    "location": uuidlocation"90a6ed85-a978-4c97-ac32-b38fff8a99c6",
    "organisation_code": "deltares_organisation_codea73d02c3280047a89d4d362df1914352",
    "device": "",
    "supplier": jane.doenull,
    "supplier_code": "12345"null,
    "access_modifier": null"Public",
    "value_type":1,
    "parameter_referenced_unit": 1"WNS6529",
    "threshold_min_soft": null,
    "threshold_min_hard": null,
    "threshold_max_soft": null,
    "threshold_max_hard": null,
}


 

The result of this post returns the uuid of this timeseries.

Code Block
{
"url": "https://api.ddsc.nl/api/v2/timeseries/f9295f20-de55-40d4-a356-61f6f142a36f/"
"id": 40313
"uuid": "f9295f20-de55-40d4-a356-61f6f142a36f"
"name": "28_0"
"description": "28_0"
"location": "90a6ed85-a978-4c97-ac32-b38fff8a99c6"
"organisation_code": "a73d02c3280047a89d4d362df1914352"
"device": ""
"supplier": null
"supplier_code": null
"access_modifier": "Public"
"value_type": "float"
"parameter_referenced_unit": "WNS6529"
"threshold_min_soft": null
"threshold_min_hard": null
"threshold_max_soft": null
"threshold_max_hard": null
"last_modified": "2016-02-19T14:23:55.337475"
"last_modified_by": "deltares_ddsc"
"extra_metadata": null
}

 

 

Posting events to the timeseries can be done with:

POST https://api.ddsc.nl/api/v2/timeseries/(uuid: uuid)f9295f20-de55-40d4-a356-61f6f142a36f/data/

Where uuid is the uuid of the timeseries.

 

The POST content can be JSON according the following format:

Code Block
[
  {"value": "2.0123", "datetime": "2013-02-12T09:56:12Z"},
  {"value": "2.0123", "datetime": "2013-02-13T09:56:12Z"},
  ...
]


 

This will return the following response:

Code Block
[{"datetime":"2013-02-12T09:56:12Z","value":"2.0123"},{"datetime":"2013-02-13T09:56:12Z","value":"2.0123"}]

 

For posting to image a new timeseries of value type 5 has to be created where the uuid of the location is specified. This way they can be related to each other.

Creating an "image" time series can be done as follows: 

Code Block
POST https://api.ddsc.nl/api/v2/timeseries/
{
    "name": "Locatie1",
    "description": "",
    "location": uuidlocation,
    "organisation_code": "1234567",
    "device": "",
    "supplier": jane.doe,
    "supplier_code": "12345",
    "access_modifier": null,
    "value_type":5,
    "parameter_referenced_unit": 1,
    "threshold_min_soft": null,
    "threshold_min_hard": null,
    "threshold_max_soft": null,
    "threshold_max_hard": null,
}

The uuid of this series is returned.

The images can now be posted to:

POST https://api.ddsc.nl/api/v2/timeseries/(uuid: uuid)/data/

In the header user name and password should be specified and datetime as well. Only one image per datetime can be posted.