autarc 2.0 API (0.0.1)

Download OpenAPI specification:Download

License: proprietary

Guides

This section contains guides that explain how to use the autarc API.

Authentication

To authenticate with the autarc API, you need to create an API key through the autarc app. You can then use this API key to authenticate with the autarc API by including it in the Authorization header of your HTTP requests. The API key should be prefixed with the word Bearer followed by a space. For example:

Authorization: Bearer API_KEY

Example request:

GET /api/v1/projects HTTP/1.1
Host: api2.autarc.energy
Authorization: Bearer API_KEY

API keys are scoped to the company that created them and can be used to access the resources of that company.

OAuth 2.0

Note: You likely don't need this guide. Please reach out if you think you need OAuth 2.0.

This guide explains how to authenticate against autarc with the OAuth 2.0 protocol. OAuth 2.0 is a protocol that allows a user to grant a third-party application access to their resources without sharing their credentials. This is done by providing the third-party application with an access token that can be used to access the user's resources. The access token is obtained by following a series of steps that involve the user granting permission to the third-party application. The OAuth 2.0 protocol is widely used by many popular services, such as Google, Facebook, and Twitter. In this guide, we will use the OAuth 2.0 protocol to authenticate with autarc.

Step 1: Register your application

Currently we don't support self registration of applications. Please contact us to register your application and get the client ID and client secret.

Step 2: Obtain an access token

To obtain a refresh and access token, you need to follow these steps:

  1. Redirect the user to our auth server at: https://auth.autarc.energy/oauth2/auth with the following parameters:
    • response_type=code
    • client_id=YOUR_CLIENT_ID
    • redirect_uri=YOUR_REDIRECT_URI
    • scope=offline_access

The redirect_uri must be a URL that is registered with your application.

  1. The user will be prompted to log in and authorize your application. If the user grants permission, they will be redirected back to your redirect_uri with a code parameter in the url. This code can then be exchanged for a refresh and access token in the next step.

  2. Exchange the code for a refresh and access token by making a POST request to our token endpoint at: https://auth.autarc.energy/oauth2/token with a Content-Type: application/x-www-form-urlencoded header and the following parameters:

    • grant_type=authorization_code
    • code=CODE_FROM_STEP_2
    • client_id=YOUR_CLIENT_ID
    • client_secret=YOUR_CLIENT_SECRET
    • redirect_uri=YOUR_REDIRECT_URI

The response will contain a refresh and access token that you can use to access the company's resources through the autarc API. The access token will expire after a certain amount of time, but you can use the refresh token to obtain a new access token. Requesting a new access token with the refresh token is done by making a POST request to the same token endpoint (from step 3) with the following parameters:

  • grant_type=refresh_token
  • refresh_token=REFRESH_TOKEN_FROM_STEP_3
  • client_id=YOUR_CLIENT_ID
  • client_secret=YOUR_CLIENT_SECRET

Step 3: Use the access token

Once you have obtained an access token, you can use it to access the company's resources through the autarc API. To do this, you need to include the access token in the Authorization header of your HTTP requests. The access token should be prefixed with the word Bearer followed by a space. For example:

Authorization: Bearer ACCESS_TOKEN

Projects

Creates a project

Authorizations:
bearerAuth
Request Body schema: application/json
required
name
required
string
companyId
required
string <uuid>
customerId
string or null <uuid>
status
string (ProjectStatus)
Enum: "inProgress" "completed" "archived"

The status of the project. Must be set manually.

isLead
boolean or null
Default: false

Determines if the project is a lead project

humanId
string or null

Human readable identifier. E.g. "P-001"

projectValue
number or null <float>

The value of the project. E.g. 10.000EUR

installationDate
string or null <date>
buildingType
string or null (BuildingType)
Enum: "singleOrDoubleFamilyHouse" "semiDetachedHouse" "terracedHouse" "endTerracedHouse" "multiFamilyHouse" "commercialBuilding"
buildingAge
string or null (BuildingAge)
Enum: "from2002" "from1995To2001" "from1984To1994" "from1979To1983" "from1969To1978" "from1958To1968" "from1949To1957" "from1919To1948" "before1918"
isMonumentProtected
any
Default: false

Determines if the building is monument protected

numberOfResidents
number or null

The number of residents in the building

numberOfFloors
number or null

The number of floors in the building

heatedLivingAreaM2
number or null

The heated living area in square meters. Used in the heat pump check. This is an independent value and not the total sum of room areas.

required
object or null (Address)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "inProgress",
  • "isLead": false,
  • "humanId": "string",
  • "projectValue": 0,
  • "installationDate": "2019-08-24",
  • "buildingType": "singleOrDoubleFamilyHouse",
  • "buildingAge": "from2002",
  • "isMonumentProtected": false,
  • "numberOfResidents": 0,
  • "numberOfFloors": 0,
  • "heatedLivingAreaM2": 0,
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "inProgress",
  • "isLead": false,
  • "humanId": "string",
  • "projectValue": 0,
  • "installationDate": "2019-08-24",
  • "buildingType": "singleOrDoubleFamilyHouse",
  • "buildingAge": "from2002",
  • "isMonumentProtected": false,
  • "numberOfResidents": 0,
  • "numberOfFloors": 0,
  • "heatedLivingAreaM2": 0,
  • "address": {
    }
}

Gets all projects

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get project by id

Authorizations:
bearerAuth
path Parameters
projectId
required
string

ID of the project to fetch

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "inProgress",
  • "isLead": false,
  • "humanId": "string",
  • "projectValue": 0,
  • "installationDate": "2019-08-24",
  • "buildingType": "singleOrDoubleFamilyHouse",
  • "buildingAge": "from2002",
  • "isMonumentProtected": false,
  • "numberOfResidents": 0,
  • "numberOfFloors": 0,
  • "heatedLivingAreaM2": 0,
  • "address": {
    }
}

Update a project

You only need to provide the fields you want to update.

Authorizations:
bearerAuth
path Parameters
projectId
required
string
Request Body schema: application/json
required
name
string
companyId
string <uuid>
customerId
string or null <uuid>
status
string (ProjectStatus)
Enum: "inProgress" "completed" "archived"

The status of the project. Must be set manually.

isLead
boolean or null
Default: false

Determines if the project is a lead project

humanId
string or null

Human readable identifier. E.g. "P-001"

projectValue
number or null <float>

The value of the project. E.g. 10.000EUR

installationDate
string or null <date>
buildingType
string or null (BuildingType)
Enum: "singleOrDoubleFamilyHouse" "semiDetachedHouse" "terracedHouse" "endTerracedHouse" "multiFamilyHouse" "commercialBuilding"
buildingAge
string or null (BuildingAge)
Enum: "from2002" "from1995To2001" "from1984To1994" "from1979To1983" "from1969To1978" "from1958To1968" "from1949To1957" "from1919To1948" "before1918"
isMonumentProtected
any
Default: false

Determines if the building is monument protected

numberOfResidents
number or null

The number of residents in the building

numberOfFloors
number or null

The number of floors in the building

heatedLivingAreaM2
number or null

The heated living area in square meters. Used in the heat pump check. This is an independent value and not the total sum of room areas.

object or null (Address)

Responses

Request samples

Content type
application/json
{
  • "name": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "inProgress",
  • "isLead": false,
  • "humanId": "string",
  • "projectValue": 0,
  • "installationDate": "2019-08-24",
  • "buildingType": "singleOrDoubleFamilyHouse",
  • "buildingAge": "from2002",
  • "isMonumentProtected": false,
  • "numberOfResidents": 0,
  • "numberOfFloors": 0,
  • "heatedLivingAreaM2": 0,
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "name": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "customerId": "87d8e330-2878-4742-a86f-dbbb3bf522ac",
  • "status": "inProgress",
  • "isLead": false,
  • "humanId": "string",
  • "projectValue": 0,
  • "installationDate": "2019-08-24",
  • "buildingType": "singleOrDoubleFamilyHouse",
  • "buildingAge": "from2002",
  • "isMonumentProtected": false,
  • "numberOfResidents": 0,
  • "numberOfFloors": 0,
  • "heatedLivingAreaM2": 0,
  • "address": {
    }
}

Delete a project

This action is irreversible!

Authorizations:
bearerAuth
path Parameters
projectId
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}

Customers

Create a customer

Authorizations:
bearerAuth
Request Body schema: application/json
required
companyId
required
string <uuid>
firstName
required
string
lastName
required
string
email
string or null <email>
invoiceEmail
string or null <email>
phoneNumber
string or null
isCompany
boolean
companyName
string or null
required
object or null (Address)

Responses

Request samples

Content type
application/json
{
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "user@example.com",
  • "invoiceEmail": "user@example.com",
  • "phoneNumber": "string",
  • "isCompany": true,
  • "companyName": "string",
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "firstName": "string",
  • "lastName": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "email": "user@example.com",
  • "invoiceEmail": "user@example.com",
  • "phoneNumber": "string",
  • "isCompany": true,
  • "companyName": "string",
  • "address": {
    }
}

Get all customers

Authorizations:
bearerAuth

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Get a customer by id

Authorizations:
bearerAuth
path Parameters
customerId
required
string

ID of the customer to fetch

Responses

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "firstName": "string",
  • "lastName": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "email": "user@example.com",
  • "invoiceEmail": "user@example.com",
  • "phoneNumber": "string",
  • "isCompany": true,
  • "companyName": "string",
  • "address": {
    }
}

Update a customer

You only need to provide the fields you want to update.

Authorizations:
bearerAuth
path Parameters
customerId
required
string
Request Body schema: application/json
required
companyId
string <uuid>
firstName
string
lastName
string
email
string or null <email>
invoiceEmail
string or null <email>
phoneNumber
string or null
isCompany
boolean
companyName
string or null
object or null (Address)

Responses

Request samples

Content type
application/json
{
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "firstName": "string",
  • "lastName": "string",
  • "email": "user@example.com",
  • "invoiceEmail": "user@example.com",
  • "phoneNumber": "string",
  • "isCompany": true,
  • "companyName": "string",
  • "address": {
    }
}

Response samples

Content type
application/json
{
  • "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
  • "firstName": "string",
  • "lastName": "string",
  • "companyId": "8bb73d03-06b4-47c7-80c7-59301f770eda",
  • "createdAt": "2019-08-24T14:15:22Z",
  • "updatedAt": "2019-08-24T14:15:22Z",
  • "email": "user@example.com",
  • "invoiceEmail": "user@example.com",
  • "phoneNumber": "string",
  • "isCompany": true,
  • "companyName": "string",
  • "address": {
    }
}

Delete a customer

This action is irreversible!

Authorizations:
bearerAuth
path Parameters
customerId
required
string

Responses

Response samples

Content type
application/json
{
  • "message": "string"
}