Relay API

OAuth

IssueOAuthToken

OAuth 2.0 token endpoint. Supports the client_credentials grant. Credentials may be sent in the request body or via HTTP Basic authentication.

Request Body schema: application/json
grant_type
required
string
Value: "client_credentials"

OAuth 2.0 grant type. Only "client_credentials" is supported.

client_id
string

The OAuth client id. May alternatively be provided via HTTP Basic auth.

client_secret
string

The OAuth client secret. May alternatively be provided via HTTP Basic auth.

scope
string

Space-separated list of requested scopes. For the following iterations. This field should be omitted for now.

Responses

Request samples

Content type
application/json
{
  • "grant_type": "client_credentials",
  • "client_id": "string",
  • "client_secret": "string",
  • "scope": "string"
}

Response samples

Content type
application/json
{
  • "access_token": "string",
  • "token_type": "Bearer",
  • "expires_in": 0,
  • "scope": "string"
}

Customers

GetCustomers

Get all customers from your account

Authorizations:
OAuth2API Key

Responses

Response samples

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

Orders

GetOrderById

Gets one specific order by ID

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "title": "string",
  • "status": "OPEN",
  • "address": {
    },
  • "dueDate": "string",
  • "followUpDate": "string",
  • "createdAt": "string",
  • "updatedAt": "string",
  • "internalId": "string",
  • "isInternal": true,
  • "type": "string",
  • "taskId": "string",
  • "propertyId": 0,
  • "casaviOrderId": 0,
  • "casaviTicketId": 0,
  • "fields": [
    ],
  • "attachments": [
    ],
  • "comments": [
    ],
  • "contactPersons": [
    ],
  • "customerId": 0,
  • "customer": {
    }
}

PatchOrder

Patches an order

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number
Request Body schema: application/json
status
string
Enum: "OPEN" "IN_PROGRESS" "FINISHED" "DECLINED" "NULL" "PREPARE"
dueDate
string <date-time>
internalId
string
object (ApiAddress)

Responses

Request samples

Content type
application/json
{
  • "status": "OPEN",
  • "dueDate": "2019-08-24T14:15:22Z",
  • "internalId": "string",
  • "address": {
    }
}

Response samples

Content type
application/json
0
0

GetOrderCommentsByOrderId

Gets all comments related to one order

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

CreateOrderComment

Creates an order comment

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number
Request Body schema: multipart/form-data
text
required
string
authorName
required
string
files
Array of arrays

A maximum of 10 files and 100 MB

Responses

Response samples

Content type
application/json
{
  • "id": 0
}

GetAllOrders

Gets all orders for one account

Authorizations:
OAuth2API Key

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetAttachmentsForOrder

Returns a Url to download a zipped file of all attachments for an order

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

GetAttachmentsForOrderComment

Returns a Url to download a zipped file of all attachments for an order comment

Authorizations:
OAuth2API Key
path Parameters
orderId
required
number
commentId
required
number

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Properties

GetProperty

Get Property by Id

Authorizations:
OAuth2API Key
path Parameters
propertyId
required
number

Responses

Response samples

Content type
application/json
{
  • "id": 0,
  • "name": "string",
  • "externalId": 0,
  • "customerId": 0,
  • "origin": "string",
  • "address": {
    },
  • "mscNumber": "string",
  • "createdAt": "string",
  • "updatedAt": "string"
}

GetProperties

Gets properties by accountId

Authorizations:
OAuth2API Key
query Parameters
limit
required
number
offset
required
number

Responses

Response samples

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

Units

GetUnits

Gets units by customer

Authorizations:
OAuth2API Key
query Parameters
limit
required
number
offset
required
number

Responses

Response samples

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

GetMscUnits

Gets units by customer. Only Units that have an mscNumber

Authorizations:
OAuth2API Key
query Parameters
limit
required
number
offset
required
number

Responses

Response samples

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

Consumptions

Eed

Consumes eed data

Authorizations:
OAuth2API Key
Request Body schema: application/json
propertyId
required
integer

ID of property

unitId
required
number

ID of unit

customerId
required
number

ID of customer

period
required
string

Month of measurement. Format: YYYY-mm

mscName
required
string

Measurement service company name

required
Array of objects (EedConsumptionDto)

Eed consumption data

required
Array of objects (BenchmarkDto)

Eed benchmark data

Responses

Request samples

Content type
application/json
{
  • "propertyId": 0,
  • "unitId": 0,
  • "customerId": 0,
  • "period": "string",
  • "mscName": "string",
  • "consumptions": [
    ],
  • "benchmarks": [
    ]
}

Appointments

CreateAppointment

Creates an appointment

Authorizations:
OAuth2API Key
Request Body schema: application/json
title
required
string

title

description
string

description

dateStart
required
string <2021-02-06 11:00:00>

dateStart

dateEnd
required
string <2021-02-06 11:00:00>

dateEnd

location
required
string

location

customerId
required
number

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "description": "string",
  • "dateStart": "string",
  • "dateEnd": "string",
  • "location": "string",
  • "customerId": 0
}

Response samples

Content type
application/json
{
  • "id": 0
}

GetAllAppointments

Get all appointments

Authorizations:
OAuth2API Key

Responses

UpdateAppointment

Updates an appointment

Authorizations:
OAuth2API Key
path Parameters
appointmentId
required
number
Request Body schema: application/json
title
string

title

description
string

description

dateStart
string <2021-02-06 11:00:00>

dateStart

dateEnd
string <2021-02-06 11:00:00>

dateEnd

location
string

location

customerId
number

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "description": "string",
  • "dateStart": "string",
  • "dateEnd": "string",
  • "location": "string",
  • "customerId": 0
}

Response samples

Content type
application/json
{
  • "id": 0
}

Documents

CreateDocument (deprecated)

[DEPRECATED] Creates a document

Authorizations:
OAuth2API Key
Request Body schema: application/json
title
required
string

The title of the document

propertyId
required
string

The property id the document should be attached to

customerId
required
string

The customer id the document is coming from

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "propertyId": "string",
  • "customerId": "string"
}

Response samples

Content type
application/json
{
  • "id": 0
}

CreateDocument

Creates a document. In order to create the document successfully we need at least one reference to a property and a customer. Therefore, please provide either a property id or internal property id and a customer id or internal customer id.

Authorizations:
OAuth2API Key
Request Body schema: application/json
title
required
string

The title of the document

propertyId
string

The property id the document should be attached to

internalPropertyId
string

The internal property id the document should be attached to

customerId
string

The customer id the document should be attached to

internalCustomerId
string

The internal customer id the document should be attached to

Responses

Request samples

Content type
application/json
{
  • "title": "string",
  • "propertyId": "string",
  • "internalPropertyId": "string",
  • "customerId": "string",
  • "internalCustomerId": "string"
}

Response samples

Content type
application/json
{
  • "id": 0
}

DocumentApiController_patchDocument

Authorizations:
OAuth2API Key
path Parameters
documentId
required
string
Request Body schema: application/json
status
required
string
Enum: "PUBLISHED" "PREPARING"

The document status

Responses

Request samples

Content type
application/json
{
  • "status": "PUBLISHED"
}

DocumentApiController_postAttachment

Authorizations:
OAuth2API Key
path Parameters
documentId
required
string
Request Body schema: application/json
name
required
string

File name

fileType
required
string

MIME Type, must be application/pdf

content
required
string

Base64 encoded content

metadata
object

Data for casavi to assign the attachment

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "fileType": "string",
  • "content": "string",
  • "metadata": { }
}