Content-Type: application/json
Authorization: API_KEY
Each request must have the headers Content-Type and Authorization set.
GET /v1/analysis/
Request body example (GET method):
{
"_id": "###",
"sections": [ # optional, defaults to all
"all", # everything below, DEFAULT, only includes things that are permitted by Auth
"basic", # Asset ID, organisation, archetype, geometry,
# and input properties (address, name, etc.)
"geometry", # IF there is a use case for having this info without the other basic info?
"scenario", # includes hazard info
"results", # includes all results by default, implies "scenario"
"metadata"
# remove "meta" section from existing output, geometry section
# already includes type, "collection" should be in basic.
],
"results_sections": [
"all", # DEFAULT
"totalRiskCost",
"RiskCostByHazard",
"RiskCostByElement",
"totalFailure",
"FailureByHazard",
"FailureByElement",
"KPIResidential",
"KPICommercial",
"KPIIndustrial"
],
"result_years": [ # optional, defaults to all
"all", # optional, defaults to all
2020,
2050, # what ever you like
],
"dependencies": {
organisations: [ # optional list of org names/IDs(?) to limit the search to
"all" # DEFAULT
],
archetypes: [ # optional list of archetypes to limit the search to
"all" # DEFAULT
],
distance: "any" # or a number in km, to filter dependencies by closeness.
#This is not high priority and can come later.
# duplicate all other options at the top level here, to select which components
# to return for each dependency, assuming Auth permits.
# Defaults to "all" for each section, for now.
}
}
PUT GET DELETE /v1/datasets/NOTE: All the results are limited to 1000 items, use the streaming APIs for transferring larger datasets.
{
"collections": [
{
"name": "COLLECTION_NAME",
"type": "Point",
"features": [
{
"_id": "89359452",
"type": "Feature",
"properties": {
"archetype": "Low Rise Flat",
"name": "16/334 PRINCES ST, PORT MELBOURNE 3207"
},
"geometry": {
"type": "Point",
"coordinates": [144.942186, -37.8356548]
}
}
]
}
]
}
PUT GET DELETE /v1/datasets/{collection_name}/
Request body example (POST method):
{
"type": "Point",
"features": [
{
"_id": "89359452",
"type": "Feature",
"properties": {
"archetype": "Low Rise Flat",
"name": "16/334 PRINCES ST, PORT MELBOURNE 3207"
},
"geometry": {
"type": "Point",
"coordinates": [144.942186, -37.8356548]
}
}
]
}
PUT GET DELETE /v1/datasets/{collection_name}/{item_id}
Request body example (POST method):
{
"type": "Feature",
"properties": {
"archetype": "Low Rise Flat",
"name": "16/334 PRINCES ST, PORT MELBOURNE 3207"
},
"geometry": {
"type": "Point",
"coordinates": [144.942186, -37.8356548]
}
}
Collection name:
wss://api.{country}.repository.xdi.systems/datasets
Client authentication:
{
"action": "AUTH",
"data": "YOUR_API_KEY"
}
Data transfer (from server to client):
{
"action": "GET",
"data": ["A", "B", "C"]
}
Data transfer (from client to server):
{
"action": "PUT",
"data": {...} // asset object
}
Data deletion:
{
"action": "DELETE",
"data": {
"property": "_id", // object property
"value": "000000" // value of the property
}
}
POST DELETE /v1/geometry/Request body examples (POST method):
{
"collections": ["A", "B"],
"properties": ["id", "name"],
"geometry": {
"type": "Box",
"coordinates": [
[150, -32], [155, -33]
]
}
}
{
"collections": ["A", "B"],
"properties": ["id", "name"],
"geometry": {
"type": "Polygon",
"coordinates": [
[[100.0, 0.0], [101.0, 0.0], [101.0, 1.0], [100.0, 1.0], [100.0, 0.0]]
]
}
}
{
"collections": ["A", "B"],
"properties": ["id", "name"],
"geometry": {
"type": "MultiPolygon",
"coordinates": [
[[[30, 20], [45, 40], [10, 40], [30, 20]]], [[[15, 5], [40, 10], [10, 20], [5, 10], [15, 5]]]
]
}
}
Collection:
wss://api.{country}.repository.xdi.systems/geometry
Client authentication:
{
"action": "AUTH",
"data": "YOUR_API_KEY"
}
Data transfer (from server to client):
{
"action": "GET",
"data": {
"collections": ["A", "B"],
"properties": ["id", "name"],
"geometry": {
"type": "Box",
"coordinates": [
[150, -32], [155, -33]
]
}
}
}
The data object definition is the same as for the Geometry API (REST).
GET /v1/extents?set=analysis_set