Appartme PaaS API (1.0.7)

Download OpenAPI specification:Download

REST API for Platform As a Service

Some useful links:

OAuth2

Request OAuth2 authorization code

query Parameters
response_type
required
string
Value: "code"
client_id
required
string
scope
required
string
Value: "user"
redirect_uri
required
string

Responses

Retrieve an access token

Request Body schema: application/x-www-form-urlencoded
client_id
required
string
client_secret
required
string
redirect_uri
required
string
grant_type
required
string
Enum: "authorization_code" "refresh_token"
code
required
string

JWT token, obtained from /oauth2/authorize flow

Responses

Response samples

Content type
application/json
{
  • "token_type": "Bearer",
  • "expires_in": 3599,
  • "access_token": "eyJhbGcxxxxxxxxxxx",
  • "scope": "user"
}

Space

List spaces

Base unit of device and services grouping in appartme service is space. Whithin single account there might be unlimited number of spaces. Space corresponds to a rental unit - appartment or any other facility. Space can be shared with users using email address.

Authorizations:
oAuth2

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Device

List devices

Authorizations:
oAuth2
query Parameters
spaceId
string

Optional space selector

deviceType
string (DeviceType)
Enum: "mm" "APRM-04-001" "APRM-03-001" "APRM-05-003" "APRM-05-002" "APRM-05-001" "APRM-07-001" "APRM-02-007" "APRM-02-006" "APRM-02-005" "APRM-02-004" "APRM-02-002" "APRM-05-005" "APRM-01-001"

Optional device type selector. For APRM codes, check useful links section on top.

Responses

Response samples

Content type
application/json
Example
[
  • {
    }
]

Device details and its properties

Authorizations:
oAuth2
path Parameters
deviceId
required
string

Responses

Response samples

Content type
application/json
{
  • "deviceId": "13a937d4-c09d-4d14-8c4e-97f5f4340288",
  • "spaceId": "13a937d4-c09d-4d14-8c4e-97f5f4340288",
  • "name": "Water meter",
  • "type": "mm",
  • "properties": [
    ]
}

Properties

Device all property value

Authorizations:
oAuth2
path Parameters
deviceId
required
string

Responses

Response samples

Content type
application/json
{
  • "values": [
    ]
}

Device property value

Authorizations:
oAuth2
path Parameters
deviceId
required
string
propertyId
required
string

Responses

Response samples

Content type
application/json
{
  • "propertyId": "waterValveOpen",
  • "type": "bool",
  • "mode": "readwrite",
  • "value": false
}

Set device property value

Authorizations:
oAuth2
path Parameters
deviceId
required
string
propertyId
required
string
Request Body schema: application/json
string or boolean or number

Responses

Request samples

Content type
application/json
{
  • "value": false
}

Response samples

Content type
application/json
{
  • "deviceId": "4de4adb9-21ee-47e3-aeb4-8cf8ed6c109a",
  • "propertyId": "string",
  • "state": "success",
  • "timestamp": "2022-07-14T01:00:00+01:00"
}

Sharing

Get list of shared entities

Authorizations:
oAuth2

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Share a space to a user

Authorizations:
oAuth2
header Parameters
content-language
string
Enum: "cs" "en" "pl" "ua" "ar" "de" "es" "fr"

Default value: en

Request Body schema: application/json
spaceId
string
sharedAt
string
expiresAt
string
sharedToEmail
string
role
string
Value: "tenant"
message
string

Optional html formated message

sendInvitationEmail
boolean
contentLanguage
string
Enum: "cs" "en" "pl" "ua" "ar" "de" "es" "fr"

Default value: en

Responses

Request samples

Content type
application/json
{
  • "spaceId": "string",
  • "sharedAt": "2022-07-13T01:00:00+01:00",
  • "expiresAt": "2022-07-14T01:00:00+01:00",
  • "sharedToEmail": "[email protected]",
  • "role": "tenant",
  • "message": "string",
  • "sendInvitationEmail": true,
  • "contentLanguage": "cs"
}

Response samples

Content type
application/json
{}

Get shared entity by id

Authorizations:
oAuth2
path Parameters
shareId
required
string

Responses

Response samples

Content type
application/json
{
  • "shareId": "6a9e781b-5ee2-4314-8665-1c09eed0443a",
  • "spaceId": "a330a273-e64a-4183-aedb-f3152797a9a5",
  • "sharedAt": "2022-07-14T01:00:00+01:00",
  • "expiresAt": "2022-07-14T01:00:00+01:00",
  • "sharedToEmail": "[email protected]",
  • "role": "tenant",
  • "status": "PENDING"
}

Patch existing shared entity by id

Updates only the fields that are present in the request body. 🤚 WARNING: if share is in ONGOING state, you cannot modify its start date.

Authorizations:
oAuth2
path Parameters
shareId
required
string
Request Body schema: application/json
sharedAt
string

ISO UTC timestamp

expiresAt
string

ISO UTC timestamp

Responses

Request samples

Content type
application/json
{
  • "sharedAt": "2022-07-14T01:00:00+01:00",
  • "expiresAt": "2022-07-14T01:00:00+01:00"
}

Response samples

Content type
application/json
{
  • "shareId": "6a9e781b-5ee2-4314-8665-1c09eed0443a",
  • "spaceId": "a330a273-e64a-4183-aedb-f3152797a9a5",
  • "sharedAt": "2022-07-14T01:00:00+01:00",
  • "expiresAt": "2022-07-14T01:00:00+01:00",
  • "sharedToEmail": "[email protected]",
  • "role": "tenant",
  • "status": "PENDING"
}

Remove shared entity by id

Authorizations:
oAuth2
path Parameters
shareId
required
string

Responses

Response samples

Content type
application/json
{
  • "meta": {
    }
}