Skenarios service has an API which can be used to maintain portfolio and properties. The base URL for all requests is https://api.skenarios.com/
...
Response | Explanation |
---|---|
200 OK | Your request was processed successfully |
201 Created | Your request was processed successfully, an object was created |
400 Bad Request | Something is wrong in the received data or query. This is most likely a format issue. |
401 Unauthorized | Your request was not authorized, please check the JWT token. |
403 Forbidden | The user specified in the JWT token has no access privileges on the given object. |
404 Not Found | The requested service doesn't exist |
422 Unprocessable Entity | Sent parameters were understood, but their content was problematic. Please check your input. |
500 Internal Server Error | Whoops! This is embarrassing, something unexpected happened. We'll take a look at the issue as soon as possible. |
...
wget --quiet \
--method POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <your JWT token here>' \
--header 'Cache-Control: no-cache' \
--body-data '{"title":"My new portfolio!", "description":"All your base are belong to us!", "dataCountry":{ "countryCode":"FI","name":"Finland"}
}' \
--output-document \
- https://api.skenarios.com/api/v1/portfolio
...
Take a note about the portfolioId, that's needed later for adding properties into the portfolio.
Create a property to the portfolio
First, we need to add a building to a recently created portfolio.
...
wget --quiet \
--method POST \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <Your JWT token here>' \
--header 'Cache-Control: no-cache' \
--body-data '{"key":"A4","description":"Studio apartment","usageType":"RESIDENTIAL","address":"Ruutikuja 1 A 4","zipCode":"02650","propertyBuildingId":<propertyBuildingId>,"city":"Espoo","floorArea":28,"floor":2}' \
--output-document \
- https://api.skenarios.com/api/v1/unit
This adds a new unit to the property. The result contains property units unit details.
{
"propertyUnitId": 168046,
"propertyBuildingId": 150605,
"propertyGroupId": 61837,
"floorArea": 28,
"floor": 2,
"name": null,
"key": "A4",
"description": "Studio apartment",
"address": "Ruutikuja 1 A 4",
"zipCode": "02650",
"city": "Espoo",
"countryCode": "FI",
"buildingKey": "1002854993",
"usageType": "RESIDENTIAL",
"params": {},
"lat": null,
"lon": null
}
...